Class SupplyCentralTradingStationAIStrategy

  • All Implemented Interfaces:
    IAITradeStrategy

    public class SupplyCentralTradingStationAIStrategy
    extends BasePlayerTradeStrategy
    Strategy to supply a central station with required wares. Required are all wares that are needed bor the basic requirement. This strategy is only chosable if there are multiple vessels available and there is a trading office in the target city.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2017 Created on Oct 21, 2017
    • Constructor Detail

      • SupplyCentralTradingStationAIStrategy

        public SupplyCentralTradingStationAIStrategy()
    • Method Detail

      • initializeTradeCycle

        public void initializeTradeCycle​(IAIPlayer player,
                                         INavigableVessel vessel)
        Description copied from interface: IAITradeStrategy
        Initialize the trade cycle. Based on the strategy the cycle may be closed, meaning at some point this method can be called again or it may be open with destination defining the next one.
        Parameters:
        player - for whom to initialize the trade cycle
        vessel - for which to initialize the trade cycle
      • handleShipArrivesInPort

        public void handleShipArrivesInPort​(IShipEntersPortEvent event)
        Description copied from interface: IAITradeStrategy
        Event handler for a ship entering port. This method is not called by subscription from the event bus, but through direct call from tha AIPlayerEngine.
        Parameters:
        event - ship entering port
      • isSelectable

        public boolean isSelectable​(IAIPlayer player,
                                    INavigableVessel vessel)
        Description copied from interface: IAITradeStrategy
        Check if this strategy can be selected in the current setup. This method is called when choosing a new strategy for the vessel.
        Parameters:
        player - for which the strategy is chosen.
        vessel - for which the strategy is chose.
        Returns:
        true if the strategy can be chosen for the player and vessel. The default implementation will always return true.