Class AutomaticTradingEngine


  • public class AutomaticTradingEngine
    extends AbstractEngine
    Author:
    Andi Hotz, (c) Sahits GmbH, 2014 Created on Dec 23, 2014
    • 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.
      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.
      void handleTradingOfficeBuilt​(ch.sahits.game.openpatrician.model.event.BuildingFinished event)
      When a traiding office is build add it.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AutomaticTradingEngine

        public AutomaticTradingEngine()
    • Method Detail

      • getChildren

        public java.util.List<AbstractEngine> getChildren()
        Description copied from class: AbstractEngine
        Any 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:
        getChildren in class AbstractEngine
        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