Interface IAICaptainHireStrategy
-
- All Known Implementing Classes:
BaseHireCaptainForShipAboveSizeStrategy,BaseHireCaptainStrategy,HireCaptainAlwaysStrategy,HireCaptainForMediumShipsStrategy,HireCaptainNeverStrategy
public interface IAICaptainHireStrategyStrategy defines if a captain should be hired.- Author:
- Andi Hotz, (c) Sahits GmbH, 2016 Created on Jul 31, 2016
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Optional<ICaptain>getCaptain(ICity city)Retrieve the captain to be hired.voidhire(IAIPlayer player, IShip vessel, ICaptain captain, ICity city)playerhirescaptainon thevessel.booleanshouldHire(IAIPlayer player, IShip vessel, ICity city)Shouldplayerhirecaptainon thevessel.
-
-
-
Method Detail
-
shouldHire
boolean shouldHire(IAIPlayer player, IShip vessel, ICity city)
Shouldplayerhirecaptainon thevessel.- Parameters:
player- making the decisionvessel- on which the captain would end upcity- where the potential captain can be hired.- Returns:
- true if the captain should be hired
-
getCaptain
java.util.Optional<ICaptain> getCaptain(ICity city)
Retrieve the captain to be hired.- Parameters:
city- where the potential captain can be hired.- Returns:
- Optional captain. Will return empty if there is no captain in the city.
-
-