Interface IAIConstructionSelectionStrategy
-
- All Known Implementing Classes:
BaseShipConstructionSelectionStrategy,BiggestShipConstructionSelectionStrategy,HometownBiggestShipConstructionSelectionStrategy,HometownRandomShipConstructionSelectionStrategy,RandomShipConstructionSelectionStrategy,TradingOfficeBiggestShipConstructionSelectionStrategy,TradingOfficeRandomShipConstructionSelectionStrategy,WestCityBiggestShipConstructionSelectionStrategy,WestCityRandomShipConstructionSelectionStrategy
public interface IAIConstructionSelectionStrategyA construction selection strategy decides if a new ship should be ordered, where it should be built and what type it should be.- Author:
- Andi Hotz, (c) Sahits GmbH, 2016 Created on Jul 30, 2016
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ICitygetBuildLocation(IAIPlayer player)Select the build location of the new ship.voidinitShipConstruction(IAIPlayer player, INavigableVessel vessel, EShipType shipType)Initialize the ship construction by collecting the wares.java.util.Optional<INavigableVessel>selectCollectingVessel(IAIPlayer player, EShipType shipType)Find a vessel that will do the collection.EShipTypeshouldBuildShipType(IAIPlayer player)Select the ship type to be built.booleanshouldOrderNewConstruction(IAIPlayer player)Check if a new ship should be ordered.
-
-
-
Method Detail
-
shouldOrderNewConstruction
boolean shouldOrderNewConstruction(IAIPlayer player)
Check if a new ship should be ordered.- Parameters:
player- for which the check should be done.- Returns:
- true if a new ship should be ordered.
-
shouldBuildShipType
EShipType shouldBuildShipType(IAIPlayer player)
Select the ship type to be built.- Parameters:
player- who whishes to build a ship- Returns:
- ship type that should be ordered
-
getBuildLocation
ICity getBuildLocation(IAIPlayer player)
Select the build location of the new ship.- Parameters:
player- who whishes to build a ship- Returns:
- city in which to order the new ship
-
initShipConstruction
void initShipConstruction(IAIPlayer player, INavigableVessel vessel, EShipType shipType)
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.
-
selectCollectingVessel
java.util.Optional<INavigableVessel> selectCollectingVessel(IAIPlayer player, EShipType shipType)
Find a vessel that will do the collection.- Parameters:
player- owning the vesselshipType- of the ship to be built and thereby the definition of the required wares.- Returns:
- vessel that is to be used for collecting the wares.
-
-