2021-08-27 15:12:48 +01:00
|
|
|
module eventy.event;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Event
|
|
|
|
*
|
2022-01-16 12:22:18 +00:00
|
|
|
* FIXME: Rename this to `Trigger`
|
|
|
|
*
|
2021-08-27 15:12:48 +01:00
|
|
|
* An Event represents a trigger for a given signal(s)
|
|
|
|
* handlers which associate with the given typeID
|
2022-01-16 12:21:09 +00:00
|
|
|
*
|
|
|
|
* It can optionally take a payload with it as well
|
2021-08-27 15:12:48 +01:00
|
|
|
*/
|
|
|
|
public class Event
|
|
|
|
{
|
|
|
|
/**
|
2022-01-16 12:21:09 +00:00
|
|
|
* Creates a new Event, optionally taking with is a
|
|
|
|
* payload
|
2021-08-27 15:12:48 +01:00
|
|
|
*/
|
2022-01-16 12:21:09 +00:00
|
|
|
this(ulong typeID, ubyte[] payload = null)
|
2021-08-27 15:12:48 +01:00
|
|
|
{
|
2021-09-01 14:33:15 +01:00
|
|
|
this.id = typeID;
|
2022-01-16 12:21:09 +00:00
|
|
|
this.payload = payload;
|
2021-08-27 15:12:48 +01:00
|
|
|
}
|
2021-08-31 10:34:29 +01:00
|
|
|
|
|
|
|
ulong id;
|
2022-01-16 12:21:09 +00:00
|
|
|
ubyte[] payload;
|
|
|
|
}
|