mirror of https://github.com/deavmi/eventy.git
Added stub types
This commit is contained in:
parent
bfa98ffee6
commit
635bdf255e
BIN
libeventdisp.a
BIN
libeventdisp.a
Binary file not shown.
|
@ -1,5 +1,9 @@
|
||||||
module eventy.engine;
|
module eventy.engine;
|
||||||
|
|
||||||
|
import eventy.queues : Queue;
|
||||||
|
import eventy.signal : Signal;
|
||||||
|
import eventy.event : Event;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Engine
|
* Engine
|
||||||
|
@ -13,5 +17,31 @@ module eventy.engine;
|
||||||
*/
|
*/
|
||||||
public final class 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;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -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)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -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 */
|
||||||
|
}
|
|
@ -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)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue