Class CollectionWaresStrategy

    • Constructor Detail

      • CollectionWaresStrategy

        public CollectionWaresStrategy()
    • Method Detail

      • initializeTradeCycle

        public void initializeTradeCycle​(ch.sahits.game.openpatrician.model.IAIPlayer player,
                                         ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
      • createMissionData

        protected abstract CollectWaresMissionData createMissionData​(ch.sahits.game.openpatrician.model.IAIPlayer player)
        Provide the mission data for collecting wares.
        Parameters:
        player - wishing to collect wares
        Returns:
        mission data for the collection of wares
      • getStrategyType

        protected abstract ch.sahits.game.openpatrician.model.player.IAITradeStrategyType getStrategyType()
        Retrieve the strategy type for this strategy.
        Returns:
        AI trade strategy type.
      • handleShipArrivesInPort

        public void handleShipArrivesInPort​(ch.sahits.game.openpatrician.model.event.IShipEntersPortEvent event)
      • checkAllWaresCollected

        protected abstract boolean checkAllWaresCollected​(ch.sahits.game.openpatrician.model.city.ICity city,
                                                          ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
                                                          CollectWaresMissionData tradeMission,
                                                          java.util.Optional<ch.sahits.game.openpatrician.model.building.ITradingOffice> tradingOffice)
        Check if all the required wares are actually collected.
        Parameters:
        city - for which to check the wares
        vessel - for which to check the wares
        tradeMission - for the vessel
        tradingOffice - trading office in the city of the player
        Returns:
        true if all wares are collected