22#ifndef PQ_EVENT_MANAGER_H_
23#define PQ_EVENT_MANAGER_H_
30typedef void (*EventCallback)();
54 EventCallback callback;
57 Listener() : unit(NULL), callback(NULL), eventType(EVENT_NONE) {}
59 Listener(
Unit* unit, EventCallback callback, EventType eventType) :
60 unit(unit), callback(callback), eventType(eventType) {
63 bool operator==(
const Listener& other)
const {
64 return unit == other.unit &&
65 callback == other.callback &&
66 eventType == other.eventType;
71 void addListener(
Unit* unit, EventCallback callback, EventType eventType);
Manages event listeners for Plaquette units.
Definition PqEvents.h:48
void clearListeners(Unit *unit)
Clears all listeners for a given unit.
Definition PqEvents.cpp:32
void addListener(Unit *unit, EventCallback callback, EventType eventType)
Adds a listener to the event manager.
Definition PqEvents.cpp:23
void step()
Performs a single step of the event manager.
Definition PqEvents.cpp:40
A hybrid array list that starts with a static array and switches to dynamic allocation when full.
Definition HybridArrayList.h:37
A generic class representing a unit in the system.
Definition PqCore.h:373