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 MapLevelcurrentMapprivate java.util.Collection<Event>globalEvents -
Constructor Summary
Constructors Constructor Description EventEngine()Default constructor -
Method Summary
Modifier and Type Method Description voidaddGlobalEvent(Event event)Adding a global event to the enginevoidclearGlobalEvents()Clear all registered global events from the enginevoidclearMap()Reset current map, to stop map events treatmentvoidinit()Initialize the Engine.voidremoveGlobalEvent(Event event)Remove a global event to the enginevoidrun()voidsetMap(MapLevel map)Set current map to activate all map eventsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
globalEvents
-
currentMap
-
-
Constructor Details
-
EventEngine
EventEngine()Default constructor
-
-
Method Details
-
init
public void init()Description copied from interface:EngineInitialize the Engine. -
run
public void run()- Specified by:
runin interfacejava.lang.Runnable
-
addGlobalEvent
Adding a global event to the engine- Parameters:
event- event to add
-
removeGlobalEvent
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
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
-