An interface for Events that can send asynchronious notifications to multiple subscribed listeners.
Implements: INotifiable
Description
The IEvent interface allows you to define events that can send asynchronous notifications to multiple subscribed listeners.
Instance methods
get_name
Gets the event name.
get_name(): str
- returns: str - the name of the event.
get_listeners
Gets all subscribed listeners.
get_listeners(): List[IEventListener]
- returns: List[IEventListener] - a list of listeners.
add_listener
Adds a listener to receive notifications for this event.
add_listener(listener: IEventListener)
- listener: IEventListener - the listener reference to add.
remove_listener
Removes a listener, so that it no longer receives notifications for this event.
remove_listener(listener: IEventListener)
- listener: IEventListener - the listener reference to remove.