@Service @Lazy @DependentInitialisation(value=ch.sahits.game.openpatrician.util.StartNewGameBean.class) 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 ShipFactory |
shipUtility |
private ServerSideTaskFactory |
taskFactory |
private ch.sahits.game.openpatrician.model.event.TimedUpdatableTaskList |
taskList |
| Constructor and Description |
|---|
ShipyardEngine() |
| Modifier and Type | Method and Description |
|---|---|
(package private) org.joda.time.DateTime |
findeLatestDate(List<ch.sahits.game.openpatrician.model.city.IShipDueDate> dueDates) |
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,
ICityPlayerProxyJFX proxy)
Refit the ship to the new level.
|
void |
repair(ch.sahits.game.openpatrician.model.city.IShipyard shipyard,
ch.sahits.game.openpatrician.model.ship.IShipGroup shipGroup)
Order the repair of a group of pirate ship.
|
private void |
repair(ch.sahits.game.openpatrician.model.city.IShipyard shipyard,
ch.sahits.game.openpatrician.model.ship.IShip ship,
ICityPlayerProxyJFX proxy)
Order the repair of the ship.
|
void |
repairAIShip(ch.sahits.game.openpatrician.model.city.IShipyard shipyard,
ch.sahits.game.openpatrician.model.ship.IShip ship)
Order the repair of a single AI owned ship.
|
void |
repairPirateShip(ch.sahits.game.openpatrician.model.city.IShipyard shipyard,
ch.sahits.game.openpatrician.model.ship.IShip ship)
Order the repair of a single pirate ship.
|
private void |
unregister() |
@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 ShipFactory shipUtility
@Autowired private ServerSideTaskFactory taskFactory
@Autowired @Qualifier(value="serverClientEventBus") private com.google.common.eventbus.AsyncEventBus clientServerEventBus
@PostConstruct private void initializeEventBus()
@PreDestroy private void unregister()
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,
ICityPlayerProxyJFX proxy)
ship - to be repaired.shipyard - reference to the statepublic void repair(ch.sahits.game.openpatrician.model.city.IShipyard shipyard,
ch.sahits.game.openpatrician.model.ship.IShipGroup shipGroup)
shipyard - where it should be repairedshipGroup - ships that should be repairedpublic void repairPirateShip(ch.sahits.game.openpatrician.model.city.IShipyard shipyard,
ch.sahits.game.openpatrician.model.ship.IShip ship)
shipyard - where it should be repairedship - that should be repairedpublic void repairAIShip(ch.sahits.game.openpatrician.model.city.IShipyard shipyard,
ch.sahits.game.openpatrician.model.ship.IShip ship)
shipyard - where it should be repairedship - that should be repairedprivate 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,
ICityPlayerProxyJFX proxy)
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 - org.joda.time.DateTime findeLatestDate(List<ch.sahits.game.openpatrician.model.city.IShipDueDate> dueDates)
Copyright © 2011-2017 Sahits GmbH. All Rights Reserved.