Class CollectionWaresStrategy
- java.lang.Object
-
- ch.sahits.game.openpatrician.engine.player.strategy.BasePlayerTradeStrategy
-
- ch.sahits.game.openpatrician.engine.player.strategy.CollectionWaresStrategy
-
- All Implemented Interfaces:
ch.sahits.game.openpatrician.model.player.IAITradeStrategy
- Direct Known Subclasses:
CollectCelebrationWaresStrategy,CollectConstructionWareStrategy
public abstract class CollectionWaresStrategy extends BasePlayerTradeStrategy
Strategy to collect wares. This strategy is not employed for normal trading. The trade mission data created bycreateMissionData(IAIPlayer)will be set on the player for the vessel.- Author:
- Andi Hotz, (c) Sahits GmbH, 2016 Created on Jul 25, 2016
-
-
Field Summary
-
Fields inherited from class ch.sahits.game.openpatrician.engine.player.strategy.BasePlayerTradeStrategy
tradeStrategyType
-
-
Constructor Summary
Constructors Constructor Description CollectionWaresStrategy()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract booleancheckAllWaresCollected(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.protected abstract CollectWaresMissionDatacreateMissionData(ch.sahits.game.openpatrician.model.IAIPlayer player)Provide the mission data for collecting wares.protected abstract ch.sahits.game.openpatrician.model.player.IAITradeStrategyTypegetStrategyType()Retrieve the strategy type for this strategy.voidhandleShipArrivesInPort(ch.sahits.game.openpatrician.model.event.IShipEntersPortEvent event)voidinitializeTradeCycle(ch.sahits.game.openpatrician.model.IAIPlayer player, ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)-
Methods inherited from class ch.sahits.game.openpatrician.engine.player.strategy.BasePlayerTradeStrategy
addDefaultTradeSteps, append, createAggregatedBuyTradeStep, createAggregatedCheckedBuyTradeStep, createAggregatedCheckedSellStep, createAggregatedDumpStep, createAggregatedSellStep, createCheckAndTakeLoanStep, createCheckedTransferToOfficeTradeStep, createCheckRepairStep, createConditionalAggregatedDumpStep, createHireCaptain, createHireDismissTradeManagerTradeStep, createHireSailorStep, createJoinGuildTradeStep, createPaybackLoanStep, createTransferToOfficeTradeStep, createTransferToShipTradeStep, createTravelToStep, createUpgradeShipTradeStep, createWeaponBuyTradeStep, executeTradeSteps, findDestinationToBuyRequiredProductionWares, findNextStopForBuying, findNextStopForSelling, findProvidingWares, findWaresOfInterest, getCityToRestartTradeCycle, getLoadedWares, getMostNeededWares, getMostNeededWares, getNextStep, getWaresNeedIn, handleHireSailors, handleRefitFinished, handleRepairFinished, hasBlockingMission, hasMoreTradeSteps, inject, isMatchingTradeStrategy, isNeeded
-
-
-
-
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 waresvessel- for which to check the warestradeMission- for the vesseltradingOffice- trading office in the city of the player- Returns:
- true if all wares are collected
-
-