void clear()
Removes all Events from the queue.
Definition: nrg_event.h:113
Event()
Default Constructor.
Definition: nrg_event.h:79
const char * reason
Statically-allocated reason for the disconnection.
Definition: nrg_event.h:49
Event(const DisconnectEvent &e)
Implicit conversion constructor from DisconnectEvent.
Definition: nrg_event.h:82
Simple queue class built on a std::vector.
Definition: nrg_queue.h:34
uint16_t id
The player's ID assigned by the library.
Definition: nrg_event.h:67
uint8_t type
Used to determine which event this is.
Definition: nrg_event.h:73
void pushEvent(const Event &e)
Add an event to the end of the queue.
Definition: nrg_event.h:98
Event raised when entities are updated, created, destroyed client-side - an alternative to the virtua...
Definition: nrg_event.h:55
Represents a connected client on the server.
Definition: nrg_player.h:34
Union to contain all the event types.
Definition: nrg_event.h:72
Event(const EntityEvent &e)
Implicit conversion constructor from EntityEvent.
Definition: nrg_event.h:85
Event raised on the server when a player joins or leaves.
Definition: nrg_event.h:65
Abstract class to be inherited by users of the library which acts as a container of one or more Field...
Definition: nrg_entity.h:37
Holds a queue of Event objects.
Definition: nrg_event.h:92
Event(const PlayerEvent &e)
Implicit conversion constructor from PlayerEvent.
Definition: nrg_event.h:88
uint16_t eid
The Entity's ID.
Definition: nrg_event.h:57
Entity * pointer
Pointer to the Entity - don't dereference it on ENTITY_DESTROYED!
Definition: nrg_event.h:59
Player * player
Pointer to the Player - don't dereference it on PLAYER_LEAVE!
Definition: nrg_event.h:68
bool pollEvent(Event &e)
Place the Event at the head of the queue into e - return true if this happened or false if the queue ...
Definition: nrg_event.h:103
EventQueue()
Default Constructor.
Definition: nrg_event.h:95
EntityEvent entity
For ENTITY_{UPDATED, CREATED, DESTROYED}.
Definition: nrg_event.h:75
uint8_t type
Will be DISCONNECTED.
Definition: nrg_event.h:48
A simple queue implementation.
uint8_t type
Will be PLAYER_{JOIN, LEAVE}.
Definition: nrg_event.h:66
uint8_t type
Will be ENTITY_{UPDATED, CREATED, DESTROYED}.
Definition: nrg_event.h:56
uint16_t etype
The Entity's user-defined type id.
Definition: nrg_event.h:58
Event raised when the Client becomes disconnected.
Definition: nrg_event.h:47
DisconnectEvent dc
For DISCONNECTED.
Definition: nrg_event.h:74
Common defines and includes used by all the other nrg header files.
PlayerEvent player
For PLAYER_{JOIN, LEAVE}.
Definition: nrg_event.h:76