Class TradingOfficeBiggestShipConstructionSelectionStrategy
- java.lang.Object
-
- ch.sahits.game.openpatrician.engine.player.strategy.BaseShipConstructionSelectionStrategy
-
- ch.sahits.game.openpatrician.engine.player.strategy.BiggestShipConstructionSelectionStrategy
-
- ch.sahits.game.openpatrician.engine.player.strategy.TradingOfficeBiggestShipConstructionSelectionStrategy
-
- All Implemented Interfaces:
IAIConstructionSelectionStrategy
public class TradingOfficeBiggestShipConstructionSelectionStrategy extends BiggestShipConstructionSelectionStrategy
This strategy builds the biggest possible ship type in a city with a trading office.- Author:
- Andi Hotz, (c) Sahits GmbH, 2016 Created on Jul 30, 2016
-
-
Constructor Summary
Constructors Constructor Description TradingOfficeBiggestShipConstructionSelectionStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) ICity
calculateCostructionCity(IAIPlayer player)
ICity
getBuildLocation(IAIPlayer player)
Select the build location of the new ship.void
initShipConstruction(IAIPlayer player, INavigableVessel vessel, EShipType shipType)
Initialize the ship construction by collecting the wares.-
Methods inherited from class ch.sahits.game.openpatrician.engine.player.strategy.BiggestShipConstructionSelectionStrategy
shouldBuildShipType
-
Methods inherited from class ch.sahits.game.openpatrician.engine.player.strategy.BaseShipConstructionSelectionStrategy
getFleetCapacity, selectCollectingVessel, shouldOrderNewConstruction
-
-
-
-
Field Detail
-
map
@Autowired private IMap map
-
rnd
@Autowired private java.util.Random rnd
-
context
@Autowired private org.springframework.context.ApplicationContext context
-
-
Method Detail
-
getBuildLocation
public ICity getBuildLocation(IAIPlayer player)
Select the build location of the new ship. The build location is always the players hometown.- Parameters:
player
-- Returns:
-
initShipConstruction
public void initShipConstruction(IAIPlayer player, INavigableVessel vessel, EShipType shipType)
Description copied from interface:IAIConstructionSelectionStrategy
Initialize the ship construction by collecting the wares. This boils down to selecting the correct implementation of CollectConstructionWareStrategy. Once the ware is collected and delivered to the built location the order must be issued. This happens in the AIPlayerEngine- Parameters:
player
- for whom to build the shipvessel
- vessel chosen to collect the waresshipType
- type of the ship to be built.
-
-