Added stub types

This commit is contained in:
Tristan B. Velloza Kildaire 2021-08-27 16:12:48 +02:00
parent bfa98ffee6
commit 635bdf255e
5 changed files with 83 additions and 0 deletions

Binary file not shown.

View File

@ -1,5 +1,9 @@
module eventy.engine;
import eventy.queues : Queue;
import eventy.signal : Signal;
import eventy.event : Event;
/**
* Engine
@ -13,5 +17,31 @@ module eventy.engine;
*/
public final class Engine
{
/* TODO: Or use a queue data structure */
private Queue[] queues;
/* TODO: Or use a queue data structure */
private Signal[] handlers;
this()
{
}
/**
* push(Event e)
*
* Provided an Event, `e`, this will enqueue the event
* to
*/
public void push(Event e)
{
}
public ulong[] getTypes()
{
/* TODO: Implement me */
return null;
}
}

18
source/eventy/event.d Normal file
View File

@ -0,0 +1,18 @@
module eventy.event;
/**
* Event
*
* An Event represents a trigger for a given signal(s)
* handlers which associate with the given typeID
*/
public class Event
{
/**
*
*/
this(ulong typeID)
{
}
}

13
source/eventy/queues.d Normal file
View File

@ -0,0 +1,13 @@
module eventy.queues;
/**
* Queue
*
* Represents a queue with a given ID that can
* have Event-s enqueued to it
*/
public final class Queue
{
private ulong id;
/* TODO: Add queue of Event's here */
}

22
source/eventy/signal.d Normal file
View File

@ -0,0 +1,22 @@
module eventy.signal;
import eventy.event : Event;
/**
* Signal
*
* Represents a signal handler that handles a given set of typeIDs
* which means that it contains an associated function to be run
* on handling of a given Event
*/
alias EventHandler = void function(Event);
public class Signal
{
private ulong[] typeIDs;
this(ulong[] typeIDs, EventHandler handler)
{
}
}