Package com.j3d.engine.react.events


package com.j3d.engine.react.events
Holds all subclasses and interfaces related to the event system.

Events

The engine, in most cases instead of trying to finder a specific class instance and method to call, makes use of "events" which allow any parts of the engine to fire events to any other part at any time of execution.

Any class which extends EventEmitter inherits event emitting capabilities to any class which it attaches that implements EventListener. Classes which cannot directly extends EventEmitter can instead implement EventEmitterInterface and hence use the generic static utilities provided by EventEmitter such as to still emit events.

An event is broadcast with an EventPayload to all attached listeners. This class can also be the superclass of concrete implementations, and it's up to the listener to decipher the payload. However, there is also a EventType enum where all event types can be categorised by a single enum before performing type casting.

Classes and interfaces

Author:
Lehlogonolo Poole
  • Class
    Description
    EventEmitter is a class that allows for other classes to attach events that they can broadcast to at any time.
    EventEmitterInterface is an interface that allows for other classes to attach events that they can broadcast to at any time.
    EventListener is an interface which just allows Objects to listen for incoming Events at any time.
    EventPayload is an abstract class which is used to represent the properties that the called event may input and or return.
    An interface which only reacts to a single event and later gets removed.
    Events is an enum that describes the possible Events that a listener can listen for.
    A simple interface for implementors to use such that they dont bloat some specific setting due to multiple events firing that do the same thing.