From c2bc5bc902a755c0a7cd9504c5f94e363c818df0 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Sun, 16 Jan 2022 14:21:09 +0200 Subject: [PATCH] Added optional payload support --- source/eventy/event.d | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/eventy/event.d b/source/eventy/event.d index b0a2933..fbbee5b 100644 --- a/source/eventy/event.d +++ b/source/eventy/event.d @@ -5,16 +5,21 @@ module eventy.event; * * An Event represents a trigger for a given signal(s) * handlers which associate with the given typeID +* +* It can optionally take a payload with it as well */ 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.payload = payload; } ulong id; -} \ No newline at end of file + ubyte[] payload; +}