Package org.collebol.client.event
Class EventHandler
java.lang.Object
org.collebol.client.event.EventHandler
Class responsible for handling and registering client events in the EJGEngine.
This class manages the registration of event listeners and the invocation of client events.
Usage:
EventHandler eventHandler = new EventHandler(engine);
Register event:
eventHandler.registerClientEvent(myEvent);
Call event:
eventHandler.callClientEvent(Event.class);
- Since:
- 1.0-dev
- Author:
- ColleBol - contact@collebol.org
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncallClientEvent(Class<? extends Event> eventClass) Returns the client event instance based on the provided event class.voidRegisters a client event listener by checking if the listener has implemented specific event handling methods.
-
Constructor Details
-
EventHandler
-
-
Method Details
-
registerClientEvent
Registers a client event listener by checking if the listener has implemented specific event handling methods.- Parameters:
event- The client listener to be registered.
-
callClientEvent
Returns the client event instance based on the provided event class.- Parameters:
eventClass- The class of the event to be returned.- Returns:
- The instance of the event if it matches one of the known client events, otherwise null.
-