Class ShipyardEngine
- java.lang.Object
-
- ch.sahits.game.openpatrician.engine.AbstractEngine
-
- ch.sahits.game.openpatrician.engine.land.city.ShipyardEngine
-
@Service @Lazy @DependentInitialisation(ch.sahits.game.openpatrician.model.initialisation.StartNewGameBean.class) public class ShipyardEngine extends AbstractEngine
The shipyard engine handled the activities on a shipyard. This engine is stateless, so it requires the IShipyard to work on.- Author:
- Andi Hotz, (c) Sahits GmbH, 2014 Created on Mar 01, 2014
-
-
Constructor Summary
Constructors Constructor Description ShipyardEngine()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<AbstractEngine>getChildren()Any engine may hold various child engines.voidhandleOrderBuildEvent(ch.sahits.game.openpatrician.event.data.ShipyardOrderBuild event)Recieve the event from the event bus and delegate it.voidhandleORderRefit(ch.sahits.game.openpatrician.event.data.ShipyardOrderRefit event)Recieve the event from the event bus and delegate it.voidhandleOrderRepair(ch.sahits.game.openpatrician.event.data.ShipyardOrderRepair event)Recieve the event from the event bus and delegate it.voidrefitAIShip(ch.sahits.game.openpatrician.model.city.IShipyard shipyard, ch.sahits.game.openpatrician.model.ship.IShip ship)voidrepair(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.voidrepairAIShip(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.voidrepairPirateShip(ch.sahits.game.openpatrician.model.city.IShipyard shipyard, ch.sahits.game.openpatrician.model.ship.IShip ship)Order the repair of a single pirate ship.
-
-
-
Method Detail
-
repair
public 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.- Parameters:
shipyard- where it should be repairedshipGroup- ships that should be repaired
-
repairPirateShip
public 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.- Parameters:
shipyard- where it should be repairedship- that should be repaired
-
repairAIShip
public 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.- Parameters:
shipyard- where it should be repairedship- that should be repaired
-
refitAIShip
public void refitAIShip(ch.sahits.game.openpatrician.model.city.IShipyard shipyard, ch.sahits.game.openpatrician.model.ship.IShip ship)
-
getChildren
public java.util.List<AbstractEngine> getChildren()
Description copied from class:AbstractEngineAny engine may hold various child engines. This is the way to retrieve them. If there are no child engines, return an empty list. Subclasses have to implement this in the proper way.- Specified by:
getChildrenin classAbstractEngine- Returns:
- list of child engines.
-
handleOrderBuildEvent
public void handleOrderBuildEvent(ch.sahits.game.openpatrician.event.data.ShipyardOrderBuild event)
Recieve the event from the event bus and delegate it.- Parameters:
event- shipyard order build
-
handleOrderRepair
public void handleOrderRepair(ch.sahits.game.openpatrician.event.data.ShipyardOrderRepair event)
Recieve the event from the event bus and delegate it.- Parameters:
event- shipyard order repair
-
handleORderRefit
public void handleORderRefit(ch.sahits.game.openpatrician.event.data.ShipyardOrderRefit event)
Recieve the event from the event bus and delegate it.- Parameters:
event- shipyard order refit
-
-