Class EventEngine


  • @Service
    @Lazy
    @DependentInitialisation(ch.sahits.game.openpatrician.model.initialisation.StartNewGameBean.class)
    public class EventEngine
    extends AbstractEngine
    This event engine triggers the various random events as well as handling the messages from the event bus that result from such an event.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2016 Created on Dec 09, 2016
    • Constructor Summary

      Constructors 
      Constructor Description
      EventEngine()  
    • 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.ClockTickDayChange event)
      Trigger events that can happen any day like plague, fire, child birth
      void handleEndOfMonthUpdates​(ch.sahits.game.event.data.PeriodicalTimeMonthEndUpdate event)
      Trigger events at the end of month like rank update.
      void handleEndOfWeekUpdates​(ch.sahits.game.event.data.PeriodicalTimeWeekEndUpdate event)
      Trigger events to be checked at the end of week like sending the bill statement.
      void handleShipEntersPort​(ch.sahits.game.openpatrician.event.data.ShipEntersPortEvent event)
      Trigger the event for a marriage broker.
      void handleWrappedStateEvents​(ch.sahits.game.openpatrician.model.ui.TargetedDialogStateWrapper dialogState)
      Handle events that are targeted at a player and contain a dialog state.
      • Methods inherited from class java.lang.Object

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

      • EventEngine

        public EventEngine()
    • 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.
      • handleWrappedStateEvents

        public void handleWrappedStateEvents​(ch.sahits.game.openpatrician.model.ui.TargetedDialogStateWrapper dialogState)
        Handle events that are targeted at a player and contain a dialog state.
        Parameters:
        dialogState - wrapped dialog state that is to be handled
      • handleShipEntersPort

        public void handleShipEntersPort​(ch.sahits.game.openpatrician.event.data.ShipEntersPortEvent event)
        Trigger the event for a marriage broker.
        Parameters:
        event - ship entered port
      • handleEndOfWeekUpdates

        public void handleEndOfWeekUpdates​(ch.sahits.game.event.data.PeriodicalTimeWeekEndUpdate event)
        Trigger events to be checked at the end of week like sending the bill statement.
        Parameters:
        event - week ended
      • handleEndOfMonthUpdates

        public void handleEndOfMonthUpdates​(ch.sahits.game.event.data.PeriodicalTimeMonthEndUpdate event)
        Trigger events at the end of month like rank update.
        Parameters:
        event - month end
      • handleDailyUpdates

        public void handleDailyUpdates​(ch.sahits.game.event.data.ClockTickDayChange event)
        Trigger events that can happen any day like plague, fire, child birth
        Parameters:
        event - daily updates