java.lang.Object
event.EventNode<T>
- Type Parameters:
T
- Type of Event Data this event is for
A class which can handle Event listeners. Automatically calls all listeners when event occurs
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Notifies the node that an event has occurred.void
subscribe
(EventListener<T> listener) Add a function to the listeners list.
-
Constructor Details
-
EventNode
public EventNode()A default constructor
-
-
Method Details
-
subscribe
Add a function to the listeners list. The function will be called when the event occurs- Parameters:
listener
- The function that is to be called when the event occurs
-
onEvent
Notifies the node that an event has occurred. Notifies all listeners- Parameters:
t
- the data that is to be given to all the listeners.
-