Class BaseHireCaptainStrategy
- java.lang.Object
-
- ch.sahits.game.openpatrician.engine.player.strategy.BaseHireCaptainStrategy
-
- All Implemented Interfaces:
IAICaptainHireStrategy
- Direct Known Subclasses:
BaseHireCaptainForShipAboveSizeStrategy
,HireCaptainAlwaysStrategy
,HireCaptainNeverStrategy
public abstract class BaseHireCaptainStrategy extends java.lang.Object implements IAICaptainHireStrategy
- Author:
- Andi Hotz, (c) Sahits GmbH, 2016 Created on Jul 31, 2016
-
-
Field Summary
Fields Modifier and Type Field Description protected CaptainsState
captainsState
private com.google.common.eventbus.AsyncEventBus
clientServerEventBus
-
Constructor Summary
Constructors Constructor Description BaseHireCaptainStrategy()
-
Method Summary
All Methods Instance Methods Concrete 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
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ch.sahits.game.openpatrician.model.player.IAICaptainHireStrategy
shouldHire
-
-
-
-
Field Detail
-
captainsState
@Autowired protected CaptainsState captainsState
-
clientServerEventBus
@Qualifier("serverClientEventBus") @Autowired private com.google.common.eventbus.AsyncEventBus clientServerEventBus
-
-
Method Detail
-
getCaptain
public java.util.Optional<ICaptain> getCaptain(ICity city)
Description copied from interface:IAICaptainHireStrategy
Retrieve the captain to be hired.- Specified by:
getCaptain
in interfaceIAICaptainHireStrategy
- Parameters:
city
- where the potential captain can be hired.- Returns:
- Optional captain. Will return empty if there is no captain in the city.
-
hire
public void hire(IAIPlayer player, IShip vessel, ICaptain captain, ICity city)
Description copied from interface:IAICaptainHireStrategy
player
hirescaptain
on thevessel
.- Specified by:
hire
in interfaceIAICaptainHireStrategy
- Parameters:
player
- doing the hiringvessel
- of the captiancaptain
- who is hired.city
- where the captain is hired.
-
-