@Service public class ShipyardEngine extends AbstractEngine
| Modifier and Type | Field and Description |
|---|---|
private com.google.common.eventbus.AsyncEventBus |
clientServerEventBus |
private ch.sahits.game.openpatrician.model.Date |
date |
private Random |
rnd |
private ch.sahits.game.openpatrician.model.ship.ShipFactory |
shipUtility |
private ServerSideTaskFactory |
taskFactory |
private ch.sahits.game.openpatrician.model.event.TimedUpdatableTaskList |
taskList |
| Constructor and Description |
|---|
ShipyardEngine() |
| Modifier and Type | Method and Description |
|---|---|
List<AbstractEngine> |
getChildren()
Any engine may hold various child engines.
|
void |
handleOrderBuildEvent(ShipyardOrderBuild event)
Recieve the event from the event bus and delegate it.
|
void |
handleORderRefit(ShipyardOrderRefit event)
Recieve the event from the event bus and delegate it.
|
void |
handleOrderRepair(ShipyardOrderRepair event)
Recieve the event from the event bus and delegate it.
|
private void |
initializeEventBus() |
private org.joda.time.DateTime |
orderShipBuilding(ch.sahits.game.openpatrician.model.city.IShipyard shipyard,
ch.sahits.game.openpatrician.model.ship.EShipType type,
ch.sahits.game.openpatrician.model.IPlayer owner)
Order a ship of given type to be build.
|
private void |
refit(ch.sahits.game.openpatrician.model.city.IShipyard shipyard,
ch.sahits.game.openpatrician.model.ship.IShip ship,
ch.sahits.game.openpatrician.model.ship.EShipUpgrade upgradeLevel)
Refit the ship to the new level.
|
private void |
repair(ch.sahits.game.openpatrician.model.city.IShipyard shipyard,
ch.sahits.game.openpatrician.model.ship.IShip ship)
Order the repair of the ship.
|
@Autowired private ch.sahits.game.openpatrician.model.Date date
@Autowired private Random rnd
@Autowired private ch.sahits.game.openpatrician.model.event.TimedUpdatableTaskList taskList
@Autowired private ch.sahits.game.openpatrician.model.ship.ShipFactory shipUtility
@Autowired private ServerSideTaskFactory taskFactory
@Autowired @Qualifier(value="serverClientEventBus") private com.google.common.eventbus.AsyncEventBus clientServerEventBus
@PostConstruct private void initializeEventBus()
private org.joda.time.DateTime orderShipBuilding(ch.sahits.game.openpatrician.model.city.IShipyard shipyard,
ch.sahits.game.openpatrician.model.ship.EShipType type,
ch.sahits.game.openpatrician.model.IPlayer owner)
type - of the ship to buildowner - of the ship to be builtshipyard - reference to the stateprivate void repair(ch.sahits.game.openpatrician.model.city.IShipyard shipyard,
ch.sahits.game.openpatrician.model.ship.IShip ship)
ship - to be repaired.shipyard - reference to the stateprivate void refit(ch.sahits.game.openpatrician.model.city.IShipyard shipyard,
ch.sahits.game.openpatrician.model.ship.IShip ship,
ch.sahits.game.openpatrician.model.ship.EShipUpgrade upgradeLevel)
ship - to be refittedupgradeLevel - level to which the ship should be upgraded.shipyard - reference to the statepublic List<AbstractEngine> getChildren()
AbstractEnginegetChildren in class AbstractEnginepublic void handleOrderBuildEvent(ShipyardOrderBuild event)
event - public void handleOrderRepair(ShipyardOrderRepair event)
event - public void handleORderRefit(ShipyardOrderRefit event)
event - Copyright © 2011-2015 Sahits GmbH. All Rights Reserved.