Class EventEngine

java.lang.Object
fr.r1r0r0.deltaengine.model.engines.EventEngine
All Implemented Interfaces:
Engine, java.lang.Runnable

final class EventEngine
extends java.lang.Object
implements Engine
The Event Engine. Executes checkEvent() method of each registered events, each tick.
  • Field Summary

    Fields
    Modifier and Type Field Description
    private MapLevel currentMap  
    private java.util.Collection<Event> globalEvents  
  • Constructor Summary

    Constructors
    Constructor Description
    EventEngine()
    Default constructor
  • Method Summary

    Modifier and Type Method Description
    void addGlobalEvent​(Event event)
    Adding a global event to the engine
    void clearGlobalEvents()
    Clear all registered global events from the engine
    void clearMap()
    Reset current map, to stop map events treatment
    void init()
    Initialize the Engine.
    void removeGlobalEvent​(Event event)
    Remove a global event to the engine
    void run()  
    void setMap​(MapLevel map)
    Set current map to activate all map events

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • globalEvents

      private final java.util.Collection<Event> globalEvents
    • currentMap

      private MapLevel currentMap
  • Constructor Details

    • EventEngine

      EventEngine()
      Default constructor
  • Method Details

    • init

      public void init()
      Description copied from interface: Engine
      Initialize the Engine.
      Specified by:
      init in interface Engine
    • run

      public void run()
      Specified by:
      run in interface java.lang.Runnable
    • addGlobalEvent

      public void addGlobalEvent​(Event event)
      Adding a global event to the engine
      Parameters:
      event - event to add
    • removeGlobalEvent

      public void removeGlobalEvent​(Event event)
      Remove a global event to the engine
      Parameters:
      event - event to remove
    • clearGlobalEvents

      public void clearGlobalEvents()
      Clear all registered global events from the engine
    • setMap

      public void setMap​(MapLevel map)
      Set current map to activate all map events
      Parameters:
      map - Map to set
    • clearMap

      public void clearMap()
      Reset current map, to stop map events treatment