public class AutomaticTradingEngine extends AbstractEngine
| Modifier and Type | Field and Description |
|---|---|
private ch.sahits.game.openpatrician.model.product.WareAmountCalculator |
calculator |
private com.google.common.eventbus.AsyncEventBus |
clientServerEventBus |
private List<ch.sahits.game.openpatrician.model.building.ITradingOffice> |
offices |
private ch.sahits.game.openpatrician.model.time.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.
|
@Autowired @Qualifier(value="serverClientEventBus") private com.google.common.eventbus.AsyncEventBus clientServerEventBus
@Autowired private ch.sahits.game.openpatrician.model.time.IIndividualPeriodicalUpdater updater
@Autowired private ch.sahits.game.openpatrician.model.product.WareAmountCalculator calculator
private List<ch.sahits.game.openpatrician.model.building.ITradingOffice> offices
@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-2015 Sahits GmbH. All Rights Reserved.