Class ShipBuildTask
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.event.TimedTask
-
- ch.sahits.game.openpatrician.engine.event.task.ShipBuildTask
-
- All Implemented Interfaces:
IShipBuildTask,java.lang.Runnable
class ShipBuildTask extends TimedTask implements IShipBuildTask
- Author:
- Andi Hotz, (c) Sahits GmbH, 2014 Created on Feb 23, 2014
-
-
Field Summary
Fields Modifier and Type Field Description private AIPlayerEngineaiPlayerEngineprivate com.google.common.eventbus.AsyncEventBusclientServerEventBusprivate javafx.geometry.Point2Dlocationprivate LocationTrackerlocationTrackerprivate IPlayerownerprivate IShipshipprivate static RandomNameLoadershipLoaderprivate ShipFactoryshipUtilityprivate IShipyardshipyardprivate EShipTypetypeprivate doublex
-
Constructor Summary
Constructors Constructor Description ShipBuildTask(java.time.LocalDateTime executionTime, EShipType type, IPlayer owner, javafx.geometry.Point2D location, IShipyard shipyard)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private intcalculateShipCapacity()private IShipcreateShip()Create the ship based on the ships type.IShipgetShipToBeBuilt()Retrieve the ship that is to be built.(package private) voidinitializeShip()voidrun()java.lang.StringtoString()
-
-
-
Field Detail
-
type
private final EShipType type
-
owner
private final IPlayer owner
-
shipUtility
@Autowired private ShipFactory shipUtility
-
aiPlayerEngine
@Autowired private AIPlayerEngine aiPlayerEngine
-
x
private final double x
-
location
private final javafx.geometry.Point2D location
-
ship
private IShip ship
-
shipyard
private final IShipyard shipyard
-
shipLoader
private static RandomNameLoader shipLoader
-
clientServerEventBus
@Autowired @Qualifier("serverClientEventBus") private com.google.common.eventbus.AsyncEventBus clientServerEventBus
-
locationTracker
@Autowired private LocationTracker locationTracker
-
-
Method Detail
-
initializeShip
@PostConstruct void initializeShip()
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
getShipToBeBuilt
public IShip getShipToBeBuilt()
Retrieve the ship that is to be built.- Specified by:
getShipToBeBuiltin interfaceIShipBuildTask- Returns:
- ship that is beeing build
-
createShip
private IShip createShip()
Create the ship based on the ships type.- Returns:
- ship that is beeing built
-
calculateShipCapacity
private int calculateShipCapacity()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-