Package com.prineside.tdi2.events
Class EventDispatcher
java.lang.Object
com.prineside.tdi2.events.EventDispatcher
- All Implemented Interfaces:
 com.esotericsoftware.kryo.KryoSerializable
- 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic DeepClassComparator<EventDispatcher>protected com.badlogic.gdx.utils.Array<EventListeners<?>>protected com.badlogic.gdx.utils.Array<Event> - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptioncom.badlogic.gdx.utils.StringBuilderdescribe()com.badlogic.gdx.utils.Array<EventListeners<?>><T extends Event>
EventListeners<T>getListeners(Class<T> eventClass) New event listener group will be registered if not yet existscom.badlogic.gdx.utils.Array<Event>boolean<T extends Event>
voidqueue(T event) Use Pools.obtain(EventType.class) to create an event object.voidread(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) protected intregisterEventType(Class<? extends Event> eventClass) protected voidreset(boolean full) Reset the dispatcher and clear it from listeners<T extends Event>
Ttrigger(T event) voidwrite(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output)  
- 
Field Details
- 
CLASS_COMPARATOR
 - 
classToId
 - 
listenerGroups
 - 
queuedEvents
 
 - 
 - 
Constructor Details
- 
EventDispatcher
public EventDispatcher() 
 - 
 - 
Method Details
- 
write
public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) - Specified by:
 writein interfacecom.esotericsoftware.kryo.KryoSerializable
 - 
read
public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) - Specified by:
 readin interfacecom.esotericsoftware.kryo.KryoSerializable
 - 
registerEventType
 - 
getListeners
New event listener group will be registered if not yet exists - 
queue
Use Pools.obtain(EventType.class) to create an event object. It will be freed back to the pool after trigger. - 
hasQueuedEvents
public boolean hasQueuedEvents() - 
trigger
 - 
getClassToId
- Returns:
 - registry of event type classes where value is an id / index in an array of listenerGroups
 
 - 
getListenerGroups
- Returns:
 - all of the registered EventListeners groups where index is a value from the classToId map
 
 - 
getQueuedEvents
- Returns:
 - an array of queued events scheduled by queue() and are awaiting to be triggered by triggerQueuedEvents()
 
 - 
reset
protected void reset(boolean full) Reset the dispatcher and clear it from listeners- Parameters:
 full- type of reset: - false (partial) - will keep the class registry and all of the FLAG_PERSISTENT listeners - true (full) - no listeners nor registered classes will remain
 - 
describe
public com.badlogic.gdx.utils.StringBuilder describe() 
 -