Class EventEngine
- java.lang.Object
-
- ch.sahits.game.openpatrician.engine.AbstractEngine
-
- ch.sahits.game.openpatrician.engine.event.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.voidhandleDailyUpdates(ch.sahits.game.event.data.ClockTickDayChange event)Trigger events that can happen any day like plague, fire, child birthvoidhandleEndOfMonthUpdates(ch.sahits.game.event.data.PeriodicalTimeMonthEndUpdate event)Trigger events at the end of month like rank update.voidhandleEndOfWeekUpdates(ch.sahits.game.event.data.PeriodicalTimeWeekEndUpdate event)Trigger events to be checked at the end of week like sending the bill statement.voidhandleShipEntersPort(ch.sahits.game.openpatrician.event.data.ShipEntersPortEvent event)Trigger the event for a marriage broker.voidhandleWrappedStateEvents(ch.sahits.game.openpatrician.model.ui.TargetedDialogStateWrapper dialogState)Handle events that are targeted at a player and contain a dialog state.
-
-
-
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.
-
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
-
-