EventRegistry


A registry for events. Used to register and retrieve event classes by ID.


Constructor






Methods


EventRegistry:create(id: string, data: table?)

Create a new event instance of the given ID, using the provided data.

Arguments:

id: string

The ID of the event.

data: table?

The data to pass to the event constructor.

Returns:

The: Event

created event instance.



EventRegistry:get(id: string)

Get the constructor function registered with the given ID.

Arguments:

id: string

The ID of the event.

Returns:

1: unknown


EventRegistry:has(id: string)

Check if an event with the given ID is registered.

Arguments:

id: string

The ID of the event.

Returns:

1: boolean


EventRegistry:register(id: string, constructor: fun( any)Event)

Register a new event with the given ID.

Arguments:

id: string

The ID of the event.

constructor: fun( any)Event

A constructor function that takes event data and returns an event instance.




Undocumented