79 static_assert(std::is_final_v<E>,
"Events must be final!");
82 template<CEntityEvent E>
class EntityEventListener;
86 static_assert(
areEntityEvents<Es...>,
"All parameters in Es must be events.");
91 template<CEntityEvent E>
static inline constexpr bool includes = (std::is_same_v<E, Es> || ...);
98 template<CEntityEvent E>
static inline constexpr bool includes =
false;
169#define CE_EXTERN_ENTITY_EVENT_BASE(T, EXTERN) \
170 EXTERN template struct ::CeresEngine::EntityEvent<T>; \
171 EXTERN template class ::CeresEngine::TEntityEventType<T>; \
172 EXTERN template const ::CeresEngine::EntityEventType& ::CeresEngine::EntityEventType::get<T>() noexcept;
173#define CE_EXTERN_ENTITY_EVENT(T) CE_EXTERN_ENTITY_EVENT_BASE(T, extern)
174#define CE_EXTERN_ENTITY_EVENT_IMPL(T) CE_EXTERN_ENTITY_EVENT_BASE(T, )
#define CE_SCRIPT_EXPORT(...)
The CE_SCRIPT_EXPORT macro marks a class or method as exportable and available in scripting environme...
Definition Macros.hpp:247
Definition EventManager.hpp:24
A type that describes and provides type-erased operations on a entity event.
Definition Event.hpp:103
friend bool operator==(const EntityEventType &lhs, const EntityEventType &rhs) noexcept
Compares two EntityEventType instances for equality.
Definition Event.hpp:125
EntityEventType(EntityEventType &&)=delete
EntityEventType(const EntityEventType &)=delete
EntityEventType(const EntityEventID eventID)
Definition Event.hpp:110
friend bool operator!=(const EntityEventType &lhs, const EntityEventType &rhs) noexcept
Compares two EntityEventType instances for inequality.
Definition Event.hpp:134
EntityEventType & operator=(const EntityEventType &)=delete
const EntityEventID eventID
The event type ID.
Definition Event.hpp:107
EntityEventType & operator=(EntityEventType &&)=delete
The base entity class.
Definition Entity.hpp:41
Definition EntityManager.hpp:49
An implementation of the EntityEventType interface that implements type-erased operations for events.
Definition Event.hpp:146
TEntityEventType()
Creates a new instance of a event type object for the given E event type.
Definition Event.hpp:152
static EntityEventID getEventID() noexcept
Definition Event.hpp:156
Base template for the event class.
Definition Event.hpp:27
Definition Application.hpp:19
constexpr bool areEntityEvents
A trait that checks if the types Es are all events.
Definition Event.hpp:63
constexpr void checkEvent()
A trait that checks if the type E is a valid event type.
Definition Event.hpp:77
constexpr bool isEntityEvent
A trait that checks if the type E is a event.
Definition Event.hpp:59
typename std::enable_if< isEntityEvent< E >, T >::type ifEntityEvent
If the type E is a event (as defined by isEntityEvent<E>), this type is aliased to T.
Definition Event.hpp:70
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
unsigned int EntityEventID
A numeric type that represents a event.
Definition Event.hpp:22
A abstract class that provides a trait that allows checking for event implementations.
Definition Event.hpp:26
virtual ~AbstractEntityEvent()=default
Defaulted virtual destructor.
A template class that wraps a event.
Definition Event.hpp:43
static EntityEventID getEventID() noexcept
Definition Event.hpp:167
static const EntityEventID eventID
This entity event type ID.
Definition Event.hpp:54