1
0
mirror of https://github.com/deavmi/eventy.git synced 2024-09-21 03:02:53 +02:00
eventy/source/eventy/types.d
Tristan B. Velloza Kildaire 7621ee5343 Completely overhauled Eventy system for the v0.4.0 release
Removed the event-loop for a better system (for now) whereby we just dispatch signal handlers on the call to `push(Event)`.

In a future release I hope to bring the event loop back but in a signal-based manner, such that we can support deferred events and priorities and such
2022-11-28 13:39:06 +02:00

40 lines
711 B
D

module eventy.types;
import eventy.event : Event;
import core.sync.mutex : Mutex;
import std.container.dlist;
import std.range;
/**
* EventType
*
* Represents a type of event. Every Event has an EventType
* and Signal(s)-handlers register to one or more of these
* types to handle
*/
public final class EventType
{
/* The EventType's ID */
private ulong id;
/**
* Instantiates a new EventType with the given id
*
* Params:
* id = The EventType's id
*/
this(ulong id)
{
this.id = id;
}
/**
* Returns the id of this EventType
*
* Returns: The id of this EventType
*/
public ulong getID()
{
return id;
}
}