public class AutomaticTradingEngine extends AbstractEngine
| Modifier and Type | Field and Description |
|---|---|
private WareAmountCalculator |
calculator |
private com.google.common.eventbus.AsyncEventBus |
clientServerEventBus |
private ch.sahits.game.openpatrician.model.product.ComputablePriceV2 |
computablePrice |
private ch.sahits.game.openpatrician.model.building.TradingOfficeList |
offices |
private IIndividualPeriodicalUpdater |
updater |
| Constructor and Description |
|---|
AutomaticTradingEngine() |
| Modifier and Type | Method and Description |
|---|---|
List<AbstractEngine> |
getChildren()
Any engine may hold various child engines.
|
void |
handleDailyUpdates(PeriodicalDailyUpdate event)
Check if the update message is addressed to this instance and find the targeted
Tradeing office.
|
void |
handleTradingOfficeBuilt(ch.sahits.game.openpatrician.model.event.BuildingFinished event)
When a traiding office is build add it.
|
private void |
initialize() |
(package private) void |
sellAndBuy(ch.sahits.game.openpatrician.model.building.ITradingOffice office)
Execute the automatic buying and selling of the automated trading.
|
private void |
unregister() |
@Autowired @Qualifier(value="serverClientEventBus") private com.google.common.eventbus.AsyncEventBus clientServerEventBus
@Autowired private IIndividualPeriodicalUpdater updater
@Autowired private WareAmountCalculator calculator
@Autowired private ch.sahits.game.openpatrician.model.building.TradingOfficeList offices
@Autowired private ch.sahits.game.openpatrician.model.product.ComputablePriceV2 computablePrice
@PreDestroy private void unregister()
@PostConstruct private void initialize()
public List<AbstractEngine> getChildren()
AbstractEnginegetChildren in class AbstractEnginepublic void handleTradingOfficeBuilt(ch.sahits.game.openpatrician.model.event.BuildingFinished event)
event - public void handleDailyUpdates(PeriodicalDailyUpdate event)
event - void sellAndBuy(ch.sahits.game.openpatrician.model.building.ITradingOffice office)
office - Copyright © 2011-2017 Sahits GmbH. All Rights Reserved.