Skip to content
Jason El-Massih edited this page Jan 27, 2016 · 3 revisions

To prevent extensive calling across subsystems, a game event system is used to communicate between subsystems.

Events are created by inheriting BaseEventData, adding any additional data, serialization, or copy logic required by the event. All events also need an EventType field defined with a GUID to be uniquely identified across the application.

To define callbacks for specific events, Bombast Engine uses the fastdelegate library. This allows a method to be bound to an existing event with the following code (In this example GameSampleLogic::StartMoveUpDelegate() will be called when the EvtData_StartUp event is emitted):

pEventManager->VAddListener(fastdelegate::MakeDelegate(this, &GameSampleLogic::StartMoveUpDelegate), EvtData_StartUp::sEventType);
  • EventManager::VAddListener is used to register a listener delegate
  • EventManager::VRemoveListener is used to remove a registered listener delegate
  • EventManager::VTriggerEvent emits a given event immediately to all listeners
  • EventManager::VQueueEvent emits a given event next EventManager::VUpdate (Allows to be aborted via EventManager::VAbortEvent)

Clone this wiki locally