-
Notifications
You must be signed in to change notification settings - Fork 3
Events
tiffany352 edited this page Aug 9, 2012
·
6 revisions
Events are the backbone of IntenseLogic. Every "change" that may happen - be it through simulation, player input, or the network, will fire off an event to be handled by callbacks. See event.h for full details.
The original concept came from tiffany, who needed a new structure for the engine through previous failed attempts. Events help to slow down the advance of a spaghettified architecture.
Each event has 3 components:
- The range, which describes what module created it (common, graphics, network, etc.)
- The ID, which describes the individual type of the ID (tick, startup, update position, etc.)
- The data, which describes anything passed with the event (what key in a keydown event, the position and ID of an object when updating position, etc.)
Events in IntenseLogic are stored in a linked list queue, so that when you push an event, it is appended to the end with minimal effort, and when you pop an event, it is removed from the beginning with minimal effort. This ensures that all events will be handled.