ch.sahits.game.openpatrician.model.player.IAITradeStrategyCentralStorageDeliveryTradeStrategy, CheapProductionTradeStrategy, CollectionWaresStrategy, DynamicTradeRouteStrategy, ProductionChainTradeStrategy, SupplyCentralTradingStationAIStrategy, SupplyHometownAIStrategy, TradeRouteTradeStrategypublic abstract class BasePlayerTradeStrategy
extends java.lang.Object
implements ch.sahits.game.openpatrician.model.player.IAITradeStrategy
| Modifier and Type | Field | Description |
|---|---|---|
protected ch.sahits.game.openpatrician.model.player.IAITradeStrategyType |
tradeStrategyType |
| Constructor | Description |
|---|---|
BasePlayerTradeStrategy() |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
addDefaultTradeSteps(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.city.ICity city,
ch.sahits.game.openpatrician.model.city.ICity nextStop,
java.util.Set<ch.sahits.game.openpatrician.model.product.IWare> nonSellableWares,
java.util.Set<ch.sahits.game.openpatrician.model.product.IWare> buyWares,
boolean skipRepair) |
Add default trading steps:
AggregatesSellTradeStep
PayBackLoanTradeStep
CheckHireCaptainTradeStep
GuildJoinTradeStep
HireDismissTradeManagerTradeStep
TakeLoanTradeStep
HireDismissTradeManagerTradeStep
BuyWeaponTradeStep
CheckForRepairTradeStep
HireSailorsStep
TravelToTradeStep
|
void |
append(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.product.ITradeStep step) |
Add a new trade step for a player.
|
protected AggregatedBuyTradeStep |
createAggregatedBuyTradeStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.city.ICity city,
java.util.List<ch.sahits.game.openpatrician.model.product.IWare> waresToBuy) |
|
protected AggregatedCheckedBuyTradeStep |
createAggregatedCheckedBuyTradeStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.city.ICity city,
java.util.List<ch.sahits.game.openpatrician.model.product.IWare> waresToBuy) |
|
protected AggregatesCheckedSellTradeStep |
createAggregatedCheckedSellStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.city.ICity city,
java.util.Map<ch.sahits.game.openpatrician.model.product.IWare,java.lang.Integer> waresToSell) |
|
protected AggregatesDumpTradeStep |
createAggregatedDumpStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.city.ICity city,
java.util.List<ch.sahits.game.openpatrician.model.product.IWare> waresToSell) |
|
protected AggregatesSellTradeStep |
createAggregatedSellStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.city.ICity city,
java.util.List<ch.sahits.game.openpatrician.model.product.IWare> waresToSell) |
|
protected TakeLoanTradeStep |
createCheckAndTakeLoanStep(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.city.ICity city) |
Create a new instance of the TakeLoan trade step.
|
protected CheckedTransferToOfficeTradeStep |
createCheckedTransferToOfficeTradeStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.city.ICity city,
java.util.Map<ch.sahits.game.openpatrician.model.product.IWare,java.lang.Integer> transferAmounts) |
|
protected CheckForRepairTradeStep |
createCheckRepairStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.city.ICity city) |
Create the trade step to check for repairs.
|
protected AmountBasedAggregatedDumpTradeStep |
createConditionalAggregatedDumpStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.city.ICity city,
java.util.List<ch.sahits.game.openpatrician.model.product.IWare> waresToSell,
int maxAmount) |
Create a conditional dump trade step.
|
protected CheckHireCaptainTradeStep |
createHireCaptain(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.city.ICity city,
ch.sahits.game.openpatrician.model.IAIPlayer player) |
Create the trade step to check and hire a captain.
|
protected HireDismissTradeManagerTradeStep |
createHireDismissTradeManagerTradeStep(ch.sahits.game.openpatrician.model.city.ICity city,
ch.sahits.game.openpatrician.model.IAIPlayer player) |
|
protected HireSailorsStep |
createHireSailorStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.city.ICity city) |
Create a new instance forthe hire sailor step.
|
protected GuildJoinTradeStep |
createJoinGuildTradeStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.city.ICity city,
ch.sahits.game.openpatrician.model.IAIPlayer player) |
Create a trade step to join the quild.
|
protected PayBackLoanTradeStep |
createPaybackLoanStep(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.city.ICity city) |
Create a new instance of the TakeLoan trade step.
|
protected TransferToOfficeTradeStep |
createTransferToOfficeTradeStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.city.ICity city) |
|
protected TransferToShipTradeStep |
createTransferToShipTradeStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.city.ICity city,
java.util.Map<ch.sahits.game.openpatrician.model.product.IWare,java.lang.Integer> transfereableAmounts) |
|
protected TravelToTradeStep |
createTravelToStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.city.ICity travelToCity) |
Create the travel step to a different city.
|
protected UpgradeShipTradeStep |
createUpgradeShipTradeStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.IAIPlayer player) |
|
protected BuyWeaponTradeStep |
createWeaponBuyTradeStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.city.ICity city) |
|
boolean |
executeTradeSteps(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel) |
The implementation of the execute trade steps makes the following assumptions:
When called there is at least one trade step defined
Typically the trade steps are defined up to the travel step.
|
protected ch.sahits.game.openpatrician.model.city.ICity |
findDestinationToBuyRequiredProductionWares(ch.sahits.game.openpatrician.model.IAIPlayer player,
java.util.List<ch.sahits.game.openpatrician.model.product.IWare> requiredWares,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
java.util.Set<ch.sahits.game.openpatrician.model.city.ICity> excludeCity) |
Determine the city to travel to based on the required wares.
|
protected ch.sahits.game.openpatrician.model.city.ICity |
findNextStopForBuying(ch.sahits.game.openpatrician.model.city.ICity baseTown,
ch.sahits.game.openpatrician.model.player.IProductionConsumptionKnowledge knowledge,
java.util.List<ch.sahits.game.openpatrician.model.product.IWare> waresOfInterest,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.city.ICity exclude) |
Figure out what the next stop should be to supply the ware in the list
waresOfInterest. |
protected ch.sahits.game.openpatrician.model.city.ICity |
findNextStopForSelling(ch.sahits.game.openpatrician.model.city.ICity baseTown,
ch.sahits.game.openpatrician.model.player.IProductionConsumptionKnowledge knowledge,
java.util.List<ch.sahits.game.openpatrician.model.product.IWare> waresOfInterest,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.city.ICity exclude) |
Figure out what the next stop should be to sell the ware in the list
waresOfInterest. |
protected ch.sahits.game.openpatrician.model.city.ICity |
findProvidingWares(ch.sahits.game.openpatrician.model.city.ICity source,
java.util.Collection<ch.sahits.game.openpatrician.model.product.IWare> wares,
java.util.Collection<ch.sahits.game.openpatrician.model.city.ICity> excluded,
ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel) |
Find the city that provides the best match for supplying the
wares while not being too
far away. |
protected java.util.ArrayList<ch.sahits.game.openpatrician.model.product.IWare> |
findWaresOfInterest(java.util.List<javafx.util.Pair<ch.sahits.game.openpatrician.model.product.IWare,java.lang.Number>> sortedNeeds) |
|
ch.sahits.game.openpatrician.model.city.ICity |
getCityToRestartTradeCycle(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel) |
The default implementation chooses the closest city. |
protected java.util.List<ch.sahits.game.openpatrician.model.product.IWare> |
getLoadedWares(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel) |
Find all wares that are loaded on the ship.
|
java.util.List<javafx.util.Pair<ch.sahits.game.openpatrician.model.product.IWare,java.lang.Number>> |
getMostNeededWares(ch.sahits.game.openpatrician.model.player.ICityProductionConsumptionKnowledge knowledge) |
Figure out the ware that are most needed in the city.
|
java.util.List<javafx.util.Pair<ch.sahits.game.openpatrician.model.product.IWare,java.lang.Number>> |
getMostNeededWares(ch.sahits.game.openpatrician.model.player.ICityProductionConsumptionKnowledge knowledge,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel) |
Figure out the ware that are most needed in the city.
|
ch.sahits.game.openpatrician.model.product.ITradeStep |
getNextStep(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel) |
Retrieve the next trade step that should be executed and remove it from the list of an AI player.
|
protected java.util.List<ch.sahits.game.openpatrician.model.product.IWare> |
getWaresNeedIn(ch.sahits.game.openpatrician.model.player.IProductionConsumptionKnowledge knowledge,
ch.sahits.game.openpatrician.model.player.ICityProductionConsumptionKnowledge knowledgeCurrentTown,
ch.sahits.game.openpatrician.model.city.ICity nextStop) |
Figure out what wares are needed in
nextStop, that can be provided in the current town. |
void |
handleHireSailors(ch.sahits.game.openpatrician.event.data.ai.HireSailorEvent event) |
Andling the hiring of sailors.
|
void |
handleRefitFinished(ch.sahits.game.openpatrician.event.data.RefitFinishedEvent event) |
Handle the event of the ship coming back from repair and the trade steps have to
be picked up again.
|
void |
handleRepairFinished(ch.sahits.game.openpatrician.event.data.RepairFinishedEvent event) |
Handle the event of the ship coming back from repair and the trade steps have to
be picked up again.
|
boolean |
hasMoreTradeSteps(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel) |
Check whether the AI player has more trade steps
|
void |
inject(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.product.ITradeStep step) |
Add a new trade step to the begining of the list.
|
protected boolean |
isMatchingTradeStrategy(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel) |
|
boolean |
isNeeded(ch.sahits.game.openpatrician.model.player.ICityProductionConsumptionKnowledge knowledge,
ch.sahits.game.openpatrician.model.product.IWare ware) |
Check if the
ware is needed in a city. |
protected ch.sahits.game.openpatrician.model.player.IAITradeStrategyType tradeStrategyType
protected boolean isMatchingTradeStrategy(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
public ch.sahits.game.openpatrician.model.city.ICity getCityToRestartTradeCycle(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
getCityToRestartTradeCycle in interface ch.sahits.game.openpatrician.model.player.IAITradeStrategyvessel - that should travel to a city, so that the trade cycle can be reinitializedpublic ch.sahits.game.openpatrician.model.product.ITradeStep getNextStep(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
player - on witch to retrieve the next taskpublic boolean hasMoreTradeSteps(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
player - on which to checkpublic void append(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.product.ITradeStep step)
player - for which to add the trade stepstep - to be added.public void inject(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.product.ITradeStep step)
player - for which to add the trade stepstep - to be added.vessel - for which the trade step is to be injected.public java.util.List<javafx.util.Pair<ch.sahits.game.openpatrician.model.product.IWare,java.lang.Number>> getMostNeededWares(ch.sahits.game.openpatrician.model.player.ICityProductionConsumptionKnowledge knowledge)
knowledge - base knowledgepublic boolean isNeeded(ch.sahits.game.openpatrician.model.player.ICityProductionConsumptionKnowledge knowledge,
ch.sahits.game.openpatrician.model.product.IWare ware)
ware is needed in a city.knowledge - of the city that should be checked.ware - for which should be checked.public java.util.List<javafx.util.Pair<ch.sahits.game.openpatrician.model.product.IWare,java.lang.Number>> getMostNeededWares(ch.sahits.game.openpatrician.model.player.ICityProductionConsumptionKnowledge knowledge,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
vessel. That ware is treated the same way as if it stored in the city, with the
effect that on the first call the most needed ware might be BEER, but once an amount is bought the most needed ware might
change.knowledge - base knowledgevessel - on which the wares are loaded.protected java.util.List<ch.sahits.game.openpatrician.model.product.IWare> getWaresNeedIn(ch.sahits.game.openpatrician.model.player.IProductionConsumptionKnowledge knowledge,
ch.sahits.game.openpatrician.model.player.ICityProductionConsumptionKnowledge knowledgeCurrentTown,
ch.sahits.game.openpatrician.model.city.ICity nextStop)
nextStop, that can be provided in the current town.knowledge - base knowledgeknowledgeCurrentTown - knowledge of the current townnextStop - stop of the next city.nextStopprotected ch.sahits.game.openpatrician.model.city.ICity findNextStopForBuying(ch.sahits.game.openpatrician.model.city.ICity baseTown,
ch.sahits.game.openpatrician.model.player.IProductionConsumptionKnowledge knowledge,
java.util.List<ch.sahits.game.openpatrician.model.product.IWare> waresOfInterest,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.city.ICity exclude)
waresOfInterest.
This list is ordered so that wares in the front are more important. The next stop is determined by the
list of waresOfInterest that should be produced.baseTown - city from which the travel startsknowledge - datawaresOfInterest - ordered list of needed waresexclude - city to which should not be traveled.protected ch.sahits.game.openpatrician.model.city.ICity findNextStopForSelling(ch.sahits.game.openpatrician.model.city.ICity baseTown,
ch.sahits.game.openpatrician.model.player.IProductionConsumptionKnowledge knowledge,
java.util.List<ch.sahits.game.openpatrician.model.product.IWare> waresOfInterest,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.city.ICity exclude)
waresOfInterest.
The next stop is determined by thelist of waresOfInterest that should be consumed.baseTown - city from which the travel startsknowledge - datawaresOfInterest - list of needed waresexclude - city to which should not be traveled.protected TravelToTradeStep createTravelToStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.city.ICity travelToCity)
vessel - that is travellingtravelToCity - destination cityprotected CheckForRepairTradeStep createCheckRepairStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.city.ICity city)
vessel - that should be checked.city - in which should be checked.protected HireSailorsStep createHireSailorStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.city.ICity city)
vessel - for which the sailors are hiredcity - in which the sailors are to be hiredprotected TakeLoanTradeStep createCheckAndTakeLoanStep(ch.sahits.game.openpatrician.model.IAIPlayer player, ch.sahits.game.openpatrician.model.city.ICity city)
player - that takes a loancity - in which the loan is takenprotected PayBackLoanTradeStep createPaybackLoanStep(ch.sahits.game.openpatrician.model.IAIPlayer player, ch.sahits.game.openpatrician.model.city.ICity city)
player - that takes a loancity - in which the loan is takenprotected AggregatedBuyTradeStep createAggregatedBuyTradeStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.city.ICity city, java.util.List<ch.sahits.game.openpatrician.model.product.IWare> waresToBuy)
protected AggregatedCheckedBuyTradeStep createAggregatedCheckedBuyTradeStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.city.ICity city, java.util.List<ch.sahits.game.openpatrician.model.product.IWare> waresToBuy)
protected AggregatesSellTradeStep createAggregatedSellStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.city.ICity city, java.util.List<ch.sahits.game.openpatrician.model.product.IWare> waresToSell)
protected AggregatesCheckedSellTradeStep createAggregatedCheckedSellStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.city.ICity city, java.util.Map<ch.sahits.game.openpatrician.model.product.IWare,java.lang.Integer> waresToSell)
protected AggregatesDumpTradeStep createAggregatedDumpStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.city.ICity city, java.util.List<ch.sahits.game.openpatrician.model.product.IWare> waresToSell)
protected AmountBasedAggregatedDumpTradeStep createConditionalAggregatedDumpStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.city.ICity city, java.util.List<ch.sahits.game.openpatrician.model.product.IWare> waresToSell, int maxAmount)
maxAmount.vessel - in the trade stepcity - where the trade step happenswaresToSell - list of wares that should be soldmaxAmount - max amount of wares that should be on the shipprotected CheckHireCaptainTradeStep createHireCaptain(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.city.ICity city, ch.sahits.game.openpatrician.model.IAIPlayer player)
vessel - for on wich the captain is hiredcity - in which the captain is hiredplayer - who hires the captainprotected GuildJoinTradeStep createJoinGuildTradeStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.city.ICity city, ch.sahits.game.openpatrician.model.IAIPlayer player)
vessel - for which the trade step is addedcity - in which the guild is locatedplayer - wishing to join the guildprotected HireDismissTradeManagerTradeStep createHireDismissTradeManagerTradeStep(ch.sahits.game.openpatrician.model.city.ICity city, ch.sahits.game.openpatrician.model.IAIPlayer player)
protected BuyWeaponTradeStep createWeaponBuyTradeStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.IAIPlayer player, ch.sahits.game.openpatrician.model.city.ICity city)
protected TransferToOfficeTradeStep createTransferToOfficeTradeStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.city.ICity city)
protected CheckedTransferToOfficeTradeStep createCheckedTransferToOfficeTradeStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.city.ICity city, java.util.Map<ch.sahits.game.openpatrician.model.product.IWare,java.lang.Integer> transferAmounts)
protected TransferToShipTradeStep createTransferToShipTradeStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.city.ICity city, java.util.Map<ch.sahits.game.openpatrician.model.product.IWare,java.lang.Integer> transfereableAmounts)
protected UpgradeShipTradeStep createUpgradeShipTradeStep(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.IAIPlayer player)
public boolean executeTradeSteps(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
executeTradeSteps in interface ch.sahits.game.openpatrician.model.player.IAITradeStrategyplayer - for which the trade steps are to be executedvessel - for which the trade steps are to be executedpublic void handleRepairFinished(ch.sahits.game.openpatrician.event.data.RepairFinishedEvent event)
event - ship repair has finishedpublic void handleRefitFinished(ch.sahits.game.openpatrician.event.data.RefitFinishedEvent event)
event - ship refitting has finished.public void handleHireSailors(ch.sahits.game.openpatrician.event.data.ai.HireSailorEvent event)
event - sailors are hiredprotected java.util.List<ch.sahits.game.openpatrician.model.product.IWare> getLoadedWares(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
vessel - for which to check the wares.protected java.util.ArrayList<ch.sahits.game.openpatrician.model.product.IWare> findWaresOfInterest(java.util.List<javafx.util.Pair<ch.sahits.game.openpatrician.model.product.IWare,java.lang.Number>> sortedNeeds)
protected ch.sahits.game.openpatrician.model.city.ICity findDestinationToBuyRequiredProductionWares(ch.sahits.game.openpatrician.model.IAIPlayer player,
java.util.List<ch.sahits.game.openpatrician.model.product.IWare> requiredWares,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
java.util.Set<ch.sahits.game.openpatrician.model.city.ICity> excludeCity)
player - for whom to find the destinationrequiredWares - list of required waresexcludeCity - origin city to which should not be traveled.protected ch.sahits.game.openpatrician.model.city.ICity findProvidingWares(ch.sahits.game.openpatrician.model.city.ICity source,
java.util.Collection<ch.sahits.game.openpatrician.model.product.IWare> wares,
java.util.Collection<ch.sahits.game.openpatrician.model.city.ICity> excluded,
ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
wares while not being too
far away. The excluded cities are not considered.source - city on which to base distance calculation.wares - to be suppliedexcluded - cities that should be ignored.protected void addDefaultTradeSteps(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.city.ICity city,
ch.sahits.game.openpatrician.model.city.ICity nextStop,
java.util.Set<ch.sahits.game.openpatrician.model.product.IWare> nonSellableWares,
java.util.Set<ch.sahits.game.openpatrician.model.product.IWare> buyWares,
boolean skipRepair)
vessel - doing the tradeplayer - owner of the vesselcity - current citynextStop - next stopnonSellableWares - wares that cannot be soldbuyWares - wares that need to be boughtskipRepair - skip the task for repairing ships.Copyright © 2011-2018 Sahits GmbH. All Rights Reserved.