Class FormOrJoinConvoyStrategy
- java.lang.Object
-
- ch.sahits.game.openpatrician.engine.player.strategy.FormOrJoinConvoyStrategy
-
public class FormOrJoinConvoyStrategy extends java.lang.ObjectTrade step to decide if a vessel should form a convoy, join a convoy and doing so.- Author:
- Andi Hotz, (c) Sahits GmbH, 2018 Created on Sep 18, 2018
-
-
Constructor Summary
Constructors Constructor Description FormOrJoinConvoyStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<ch.sahits.game.openpatrician.model.ship.IConvoy>joinOrFormConvoy(ch.sahits.game.openpatrician.model.ship.IShip vessel, ch.sahits.game.openpatrician.model.city.ICity city)Determine if the vessel should form a convoy or join a convoy own or forign and do so.booleanmustBeFittableForOrleg(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)check if the vessel needs to be fitted to become an orleg ship.booleanshouldJoinOrFormConvoy(ch.sahits.game.openpatrician.model.IAIPlayer player)Check if there is a need for a ship of the player to join a convoy or form one.
-
-
-
Method Detail
-
mustBeFittableForOrleg
public boolean mustBeFittableForOrleg(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
check if the vessel needs to be fitted to become an orleg ship.- Parameters:
vessel- to be checked- Returns:
- true if the ship needs to be fitted as orleg ship.
-
joinOrFormConvoy
public java.util.Optional<ch.sahits.game.openpatrician.model.ship.IConvoy> joinOrFormConvoy(ch.sahits.game.openpatrician.model.ship.IShip vessel, ch.sahits.game.openpatrician.model.city.ICity city)Determine if the vessel should form a convoy or join a convoy own or forign and do so.- Parameters:
vessel- for which to check the convoycity- current city of the vessel.
-
shouldJoinOrFormConvoy
public boolean shouldJoinOrFormConvoy(ch.sahits.game.openpatrician.model.IAIPlayer player)
Check if there is a need for a ship of the player to join a convoy or form one.- Parameters:
player- for whom to check- Returns:
- false if there is no need for a ship to be in a convoy.
-
-