mirror of https://github.com/deavmi/eventy.git
Added optional payload support
This commit is contained in:
parent
72a35976e1
commit
c2bc5bc902
|
@ -5,16 +5,21 @@ module eventy.event;
|
||||||
*
|
*
|
||||||
* An Event represents a trigger for a given signal(s)
|
* An Event represents a trigger for a given signal(s)
|
||||||
* handlers which associate with the given typeID
|
* handlers which associate with the given typeID
|
||||||
|
*
|
||||||
|
* It can optionally take a payload with it as well
|
||||||
*/
|
*/
|
||||||
public class Event
|
public class Event
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
*
|
* Creates a new Event, optionally taking with is a
|
||||||
|
* payload
|
||||||
*/
|
*/
|
||||||
this(ulong typeID)
|
this(ulong typeID, ubyte[] payload = null)
|
||||||
{
|
{
|
||||||
this.id = typeID;
|
this.id = typeID;
|
||||||
|
this.payload = payload;
|
||||||
}
|
}
|
||||||
|
|
||||||
ulong id;
|
ulong id;
|
||||||
}
|
ubyte[] payload;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue