public class SupplyHometownAIStrategy extends BasePlayerTradeStrategy
| Modifier and Type | Field and Description |
|---|---|
private com.google.common.eventbus.AsyncEventBus |
clientServerEventBus |
private org.springframework.context.ApplicationContext |
context |
private org.apache.logging.log4j.Logger |
logger |
private int |
lowMoney |
private ShipService |
shipService |
tradeStrategyType| Constructor and Description |
|---|
SupplyHometownAIStrategy() |
| Modifier and Type | Method and Description |
|---|---|
private void |
addTradeStepsInHometownToTravelToNextCity(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
Add the tradesteps to buy wares in the hometown and travel to the first stop.
|
(package private) void |
addTradeStepsSellingInHomeTown(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
Add the tradesteps in the hometown to sell the wares and check for repairs
|
(package private) void |
addTradeStepTradingNextTown(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
Define the trade steps in another town.
|
private void |
destroy() |
(package private) List<ch.sahits.game.openpatrician.model.product.IWare> |
getLoadedWaresToSell(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
List<ch.sahits.game.openpatrician.model.product.IWare> waresOfInterest)
Retrieve the wares that can be soled in another city than the hometown.
|
void |
handleShipArrivesInPort(ch.sahits.game.openpatrician.model.event.IShipEntersPortEvent event) |
private void |
init() |
void |
initialzeTradeCycle(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel) |
(package private) boolean |
shouldReturnToHometown(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
Check weather the vessel should return to the hometown
|
append, clearRemainingTradeSteps, createAggregatedBuyTradeStep, createAggregatedDumpStep, createAggregatedSellStep, createCheckAndTakeLoanStep, createCheckRepairStep, createHireSailorStep, createTravelToStep, executeTradeSteps, findNextStop, findWaresOfInterest, getLoadedWares, getMostNeededWares, getMostNeededWares, getNextStep, getWaresNeedIn, handleHireSailors, handleRepairFinished, hasMoreTradeSteps, inject, isMatchingTradeStrategy, isNeededprivate final org.apache.logging.log4j.Logger logger
@Autowired @Qualifier(value="serverClientEventBus") private com.google.common.eventbus.AsyncEventBus clientServerEventBus
@Autowired private ShipService shipService
@Value(value="${aiplayer.money.low}")
private int lowMoney
@Autowired private org.springframework.context.ApplicationContext context
@PostConstruct private void init()
@PreDestroy private void destroy()
public void initialzeTradeCycle(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
public void handleShipArrivesInPort(ch.sahits.game.openpatrician.model.event.IShipEntersPortEvent event)
private void addTradeStepsInHometownToTravelToNextCity(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
player - vessel - void addTradeStepsSellingInHomeTown(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
player - vessel - void addTradeStepTradingNextTown(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
player - vessel - boolean shouldReturnToHometown(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
player - List<ch.sahits.game.openpatrician.model.product.IWare> getLoadedWaresToSell(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, List<ch.sahits.game.openpatrician.model.product.IWare> waresOfInterest)
vessel - waresOfInterest - list of wares that should be sold in the hometown and nowhere else.Copyright © 2011-2016 Sahits GmbH. All Rights Reserved.