Class CollectConstructionWareStrategy
- java.lang.Object
-
- ch.sahits.game.openpatrician.engine.player.strategy.BasePlayerTradeStrategy
-
- ch.sahits.game.openpatrician.engine.player.strategy.CollectionWaresStrategy
-
- ch.sahits.game.openpatrician.engine.player.strategy.CollectConstructionWareStrategy
-
- All Implemented Interfaces:
ch.sahits.game.openpatrician.model.player.IAITradeStrategy
- Direct Known Subclasses:
CollectionConstructionHometownWaresStrategy,CollectionConstructionTradingOfficeWaresStrategy,CollectionConstructionWestCityWaresStrategy
public abstract class CollectConstructionWareStrategy extends CollectionWaresStrategy
Base strategy for constructing a ship.- Author:
- Andi Hotz, (c) Sahits GmbH, 2016 Created on Jul 26, 2016
-
-
Field Summary
-
Fields inherited from class ch.sahits.game.openpatrician.engine.player.strategy.BasePlayerTradeStrategy
tradeStrategyType
-
-
Constructor Summary
Constructors Constructor Description CollectConstructionWareStrategy(ch.sahits.game.openpatrician.model.ship.EShipType constructionType)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected 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 CollectWaresMissionDatacreateMissionData(ch.sahits.game.openpatrician.model.IAIPlayer player)Provide the mission data for collecting wares.protected abstract ch.sahits.game.openpatrician.model.city.ICitygetConstructionCity(ch.sahits.game.openpatrician.model.IAIPlayer player)Define where the ship should be constructed.-
Methods inherited from class ch.sahits.game.openpatrician.engine.player.strategy.CollectionWaresStrategy
getStrategyType, handleShipArrivesInPort, initializeTradeCycle
-
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
-
createMissionData
protected CollectWaresMissionData createMissionData(ch.sahits.game.openpatrician.model.IAIPlayer player)
Description copied from class:CollectionWaresStrategyProvide the mission data for collecting wares.- Specified by:
createMissionDatain classCollectionWaresStrategy- Parameters:
player- wishing to collect wares- Returns:
- mission data for the collection of wares
-
getConstructionCity
protected abstract ch.sahits.game.openpatrician.model.city.ICity getConstructionCity(ch.sahits.game.openpatrician.model.IAIPlayer player)
Define where the ship should be constructed.- Parameters:
player- who builds a new ship- Returns:
- city where to build the new ship
-
checkAllWaresCollected
protected 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)Description copied from class:CollectionWaresStrategyCheck if all the required wares are actually collected.- Specified by:
checkAllWaresCollectedin classCollectionWaresStrategy- 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
-
-