public class AIPlayerEngine extends AbstractEngine implements IAIEventHandler
| Modifier and Type | Field and Description |
|---|---|
private ch.sahits.game.openpatrician.model.sea.BlockadeState |
blockadeState |
private BlockadeStrategy |
blockadeStrategy |
private com.google.common.eventbus.AsyncEventBus |
clientServerEventBus |
private ch.sahits.game.openpatrician.model.Date |
date |
private ch.sahits.game.openpatrician.util.service.DisableProperties |
disableService |
private AIPlayerEngineState |
engineState |
private EventEngineState |
eventState |
private org.apache.logging.log4j.Logger |
logger |
private MapService |
mapService |
private ch.sahits.game.openpatrician.model.AIPlayerList |
players |
private Random |
rnd |
private SeafaringService |
seafaringService |
private Queue<ShipEntersPortEvent> |
shipEntersPortEventQueue
Queue for ship enters port events.
|
private ShipyardEngine |
shipyardEngine |
private StrategyHolderService |
strategyHolderService |
private ServerSideTaskFactory |
taskFactory |
private ch.sahits.game.openpatrician.model.event.TimedUpdatableTaskList |
taskList |
private com.google.common.eventbus.AsyncEventBus |
timerEventBus |
private AITradeChecker |
tradeChecker |
private ch.sahits.game.openpatrician.model.sea.TravellingVessels |
vessels |
| Constructor and Description |
|---|
AIPlayerEngine() |
| Modifier and Type | Method and Description |
|---|---|
private void |
clearRemainingTradeSteps(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.IAIPlayer player)
Remove any remaining trade steps.
|
boolean |
executeCurrentTrade(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
Check weather the current vessel is engaged in executing trade steps.
|
List<AbstractEngine> |
getChildren()
Any engine may hold various child engines.
|
private void |
handleBlockadeMission(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.city.ICity city) |
void |
handleBlockadeStart(BlockadeShipRequestEvent event) |
void |
handleBuildingAuctionFinished(BuildingAuctionFinished event) |
void |
handleBuildingNotAuction(BuildingNotAuctioned event) |
void |
handleGameLoad(GameStateChange gameStateChange)
Listen to the start of the game loading to continue with the handling of ship arrival events.
|
void |
handleMarriageEvent(ch.sahits.game.openpatrician.model.IAIPlayer player,
MarriageBrokerAnnouncementState state)
Handle the offer of a marriage broker.
|
private void |
handleShipArrival(ShipEntersPortEvent event)
Internal handling of the ship arrival.
|
void |
handleShipArrivesInCity(ShipEntersPortEvent event) |
void |
handleShipAuctionFinished(ShipAuctionFinished event) |
void |
handleShipConstructionFinished(ch.sahits.game.openpatrician.model.ship.IShip ship,
ch.sahits.game.openpatrician.model.IAIPlayer player)
Method to handle the finishing of a ship construction.
|
void |
handleShipNotAuction(ShipNotAuctioned event) |
void |
handleSpecialMissionFinished(SpecialMissionFinishedEvent event)
Handle the reinitialisation after finishing a special mission.
|
void |
handleTradeStrategyStart(GraphInitialisationComplete event) |
void |
handleWeeklyTasks(PeriodicalTimeWeekEndUpdate event) |
private void |
init() |
void |
initializeNewShip(ch.sahits.game.openpatrician.model.ship.IShip ship,
ch.sahits.game.openpatrician.model.IAIPlayer player)
Method to handle the initializing of a trade strategy for a new ship.
|
private void |
initializeRandomTradeStrategy(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.IAIPlayer player) |
private void |
initializeStrategyForVessel(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel ship) |
private void |
startTradeStrategySteps(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel ship) |
private final org.apache.logging.log4j.Logger logger
@Autowired private ch.sahits.game.openpatrician.model.AIPlayerList players
@Autowired @Qualifier(value="serverClientEventBus") private com.google.common.eventbus.AsyncEventBus clientServerEventBus
@Autowired @Qualifier(value="timerEventBus") private com.google.common.eventbus.AsyncEventBus timerEventBus
@Autowired private ch.sahits.game.openpatrician.model.sea.BlockadeState blockadeState
@Autowired private BlockadeStrategy blockadeStrategy
@Autowired private SeafaringService seafaringService
@Autowired private ch.sahits.game.openpatrician.model.Date date
@Autowired private MapService mapService
@Autowired private ch.sahits.game.openpatrician.model.sea.TravellingVessels vessels
@Autowired private AITradeChecker tradeChecker
@Autowired private ShipyardEngine shipyardEngine
@Autowired private ch.sahits.game.openpatrician.model.event.TimedUpdatableTaskList taskList
@Autowired private ServerSideTaskFactory taskFactory
@Autowired private Random rnd
@Autowired private StrategyHolderService strategyHolderService
@Autowired private ch.sahits.game.openpatrician.util.service.DisableProperties disableService
@Autowired private EventEngineState eventState
@Autowired private AIPlayerEngineState engineState
private Queue<ShipEntersPortEvent> shipEntersPortEventQueue
public List<AbstractEngine> getChildren()
AbstractEnginegetChildren in class AbstractEngine@PostConstruct private void init()
private void initializeStrategyForVessel(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel ship)
public void handleBlockadeStart(BlockadeShipRequestEvent event)
public void handleShipArrivesInCity(ShipEntersPortEvent event)
private void handleShipArrival(ShipEntersPortEvent event)
event - public void handleGameLoad(GameStateChange gameStateChange)
gameStateChange - public void handleTradeStrategyStart(GraphInitialisationComplete event)
private void startTradeStrategySteps(ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.ship.INavigableVessel ship)
private void handleBlockadeMission(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.IAIPlayer player,
ch.sahits.game.openpatrician.model.city.ICity city)
public boolean executeCurrentTrade(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
vessel - public void handleWeeklyTasks(PeriodicalTimeWeekEndUpdate event)
private void clearRemainingTradeSteps(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.IAIPlayer player)
vessel - for which the trade steps should be checkedplayer - for which the trade steps should be checked.public void handleSpecialMissionFinished(SpecialMissionFinishedEvent event)
event - private void initializeRandomTradeStrategy(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel,
ch.sahits.game.openpatrician.model.IAIPlayer player)
public void handleShipAuctionFinished(ShipAuctionFinished event)
public void handleShipNotAuction(ShipNotAuctioned event)
public void handleBuildingAuctionFinished(BuildingAuctionFinished event)
public void handleBuildingNotAuction(BuildingNotAuctioned event)
public void handleMarriageEvent(ch.sahits.game.openpatrician.model.IAIPlayer player,
MarriageBrokerAnnouncementState state)
IAIEventHandlerhandleMarriageEvent in interface IAIEventHandlerpublic void handleShipConstructionFinished(ch.sahits.game.openpatrician.model.ship.IShip ship,
ch.sahits.game.openpatrician.model.IAIPlayer player)
ship - that is newly constructedplayer - owner of the shippublic void initializeNewShip(ch.sahits.game.openpatrician.model.ship.IShip ship,
ch.sahits.game.openpatrician.model.IAIPlayer player)
initializeNewShip in interface IAIEventHandlership - player - Copyright © 2011-2017 Sahits GmbH. All Rights Reserved.