ImagoEngine
A C++ 2D game engine built on a sparse-set ECS, with scenes, scheduled systems, events, and action-based input
Loading...
Searching...
No Matches
Broadcaster.hpp File Reference

Defines the Broadcaster to emit events for subscribed systems. More...

#include <cstdint>
#include <functional>
#include <unordered_map>
#include <algorithm>
#include <cassert>
#include <type_traits>
#include <spdlog/spdlog.h>
#include <vector>
Include dependency graph for Broadcaster.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Imago::Engine::Broadcaster
 Broadcaster acts as ImagoEngine's event system. It lets systems communicate without knowing about eachother. More...

Typedefs

using Imago::Engine::EventTypeId = uint32_t
 Alias for event ids in event storage.

Functions

template<typename T>
EventTypeId Imago::Engine::get_event_type_id ()
 Returns the EventTypeId for the event of type T.

Detailed Description

Defines the Broadcaster to emit events for subscribed systems.

Author
Shane David

Function Documentation

◆ get_event_type_id()

template<typename T>
EventTypeId Imago::Engine::get_event_type_id ( )

Returns the EventTypeId for the event of type T.

The id is assigned the first time this is called for a given event of type T. Sice the id is static the id is the same for every following call with that component type.

Template Parameters
Theevent type
Returns
The id for that event type.