75 static_assert(std::is_final_v<A>,
"Actions must be final!");
78 template<
typename A>
class EntityActionHandler;
79 class EntityActionManager;
83 static_assert(
areEntityActions<As...>,
"All parameters in As must be actions.");
88 template<CEntityAction A>
static inline constexpr bool includes = (std::is_same_v<A, As> || ...);
95 template<CEntityAction A>
static inline constexpr bool includes =
false;
166#define CE_EXTERN_ENTITY_ACTION_BASE(T, EXTERN) \
167 EXTERN template struct ::CeresEngine::EntityAction<T>; \
168 EXTERN template class ::CeresEngine::TEntityActionType<T>; \
169 EXTERN template const ::CeresEngine::EntityActionType& ::CeresEngine::EntityActionType::get<T>() noexcept;
170#define CE_EXTERN_ENTITY_ACTION(T) CE_EXTERN_ENTITY_ACTION_BASE(T, extern)
171#define CE_EXTERN_ENTITY_ACTION_IMPL(T) CE_EXTERN_ENTITY_ACTION_BASE(T, )
#define CE_EXPORT
The CE_EXPORT macro marks a symbol as exported in a DLL.
Definition Macros.hpp:229
#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
A type that describes and provides type-erased operations on a entity action.
Definition Action.hpp:100
friend bool operator!=(const EntityActionType &lhs, const EntityActionType &rhs) noexcept
Compares two EntityActionType instances for inequality.
Definition Action.hpp:131
EntityActionType(EntityActionType &&)=delete
EntityActionType(const EntityActionID actionID)
Definition Action.hpp:107
const EntityActionID actionID
The action type ID.
Definition Action.hpp:104
EntityActionType & operator=(const EntityActionType &)=delete
EntityActionType(const EntityActionType &)=delete
friend bool operator==(const EntityActionType &lhs, const EntityActionType &rhs) noexcept
Compares two EntityActionType instances for equality.
Definition Action.hpp:122
EntityActionType & operator=(EntityActionType &&)=delete
An implementation of the EntityActionType interface that implements type-erased operations for action...
Definition Action.hpp:143
TEntityActionType()
Creates a new instance of a action type object for the given A action type.
Definition Action.hpp:149
static EntityActionID getActionID() noexcept
Definition Action.hpp:153
Definition Application.hpp:19
constexpr bool isEntityAction
A trait that checks if the type C is a action.
Definition Action.hpp:49
typename std::enable_if< isEntityAction< A >, T >::type ifEntityAction
If the type A is a action (as defined by isAction<A>), this type is aliased to T.
Definition Action.hpp:59
typename std::enable_if< areEntityActions< As... >, T >::type ifEntityActions
If the types As are all actions (as defined by areActions<As>), this type is aliased to T.
Definition Action.hpp:66
unsigned int EntityActionID
A numeric type that represents a action.
Definition Action.hpp:19
constexpr bool areEntityActions
A trait that checks if the types As are all actions.
Definition Action.hpp:53
constexpr void checkAction()
A trait that checks if the type A is a valid action type.
Definition Action.hpp:73
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
A base class shared by all actions triggered by an entity.
Definition Action.hpp:22
A class that must be inherited by concrete action types.
Definition Action.hpp:33
static const EntityActionID actionID
This action type ID.
Definition Action.hpp:44
R ReturnType
The type that must be returned by action handlers.
Definition Action.hpp:36
static EntityActionID getActionID() noexcept
Definition Action.hpp:164