Interface IAICaptainHireStrategy
-
- All Known Implementing Classes:
BaseHireCaptainForShipAboveSizeStrategy
,BaseHireCaptainStrategy
,HireCaptainAlwaysStrategy
,HireCaptainForMediumShipsStrategy
,HireCaptainNeverStrategy
public interface IAICaptainHireStrategy
Strategy 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.void
hire(IAIPlayer player, IShip vessel, ICaptain captain, ICity city)
player
hirescaptain
on thevessel
.boolean
shouldHire(IAIPlayer player, IShip vessel, ICity city)
Shouldplayer
hirecaptain
on thevessel
.
-
-
-
Method Detail
-
shouldHire
boolean shouldHire(IAIPlayer player, IShip vessel, ICity city)
Shouldplayer
hirecaptain
on 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.
-
-