Class AutomaticTradingEngine
- java.lang.Object
-
- ch.sahits.game.openpatrician.engine.AbstractEngine
-
- ch.sahits.game.openpatrician.engine.land.city.AutomaticTradingEngine
-
public class AutomaticTradingEngine extends AbstractEngine
- Author:
- Andi Hotz, (c) Sahits GmbH, 2014 Created on Dec 23, 2014
-
-
Constructor Summary
Constructors Constructor Description AutomaticTradingEngine()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<AbstractEngine>getChildren()Any engine may hold various child engines.voidhandleDailyUpdates(ch.sahits.game.event.data.PeriodicalDailyUpdate event)Check if the update message is addressed to this instance and find the targeted Tradeing office.voidhandleTradingOfficeBuilt(ch.sahits.game.openpatrician.model.event.BuildingFinished event)When a traiding office is build add it.
-
-
-
Method Detail
-
getChildren
public java.util.List<AbstractEngine> getChildren()
Description copied from class:AbstractEngineAny engine may hold various child engines. This is the way to retrieve them. If there are no child engines, return an empty list. Subclasses have to implement this in the proper way.- Specified by:
getChildrenin classAbstractEngine- Returns:
- list of child engines.
-
handleTradingOfficeBuilt
public void handleTradingOfficeBuilt(ch.sahits.game.openpatrician.model.event.BuildingFinished event)
When a traiding office is build add it.- Parameters:
event- a new building has been finished
-
handleDailyUpdates
public void handleDailyUpdates(ch.sahits.game.event.data.PeriodicalDailyUpdate event)
Check if the update message is addressed to this instance and find the targeted Tradeing office. Execute the buy and sell action on the office.- Parameters:
event- daily update
-
-