CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
Action.hpp File Reference
#include "Forward.hpp"
#include "CeresEngine/Macros.hpp"
#include <type_traits>

Go to the source code of this file.

Classes

struct  CeresEngine::AbstractEntityAction
 A base class shared by all actions triggered by an entity. More...
 
struct  CeresEngine::EntityAction< T, R >
 A class that must be inherited by concrete action types. More...
 
struct  CeresEngine::EntityActionSet< As >
 
struct  CeresEngine::EntityActionSet<>
 
class  CeresEngine::EntityActionType
 A type that describes and provides type-erased operations on a entity action. More...
 
class  CeresEngine::TEntityActionType< A >
 An implementation of the EntityActionType interface that implements type-erased operations for actions. More...
 

Namespaces

namespace  CeresEngine
 

Concepts

concept  CeresEngine::CEntityAction
 

Macros

#define CE_EXTERN_ENTITY_ACTION_BASE(T, EXTERN)
 
#define CE_EXTERN_ENTITY_ACTION(T)   CE_EXTERN_ENTITY_ACTION_BASE(T, extern)
 
#define CE_EXTERN_ENTITY_ACTION_IMPL(T)   CE_EXTERN_ENTITY_ACTION_BASE(T, )
 

Typedefs

using CeresEngine::EntityActionID = unsigned int
 A numeric type that represents a action.
 
template<typename T , typename A >
using CeresEngine::ifEntityAction = typename std::enable_if< isEntityAction< A >, T >::type
 If the type A is a action (as defined by isAction<A>), this type is aliased to T.
 
template<typename T , typename... As>
using CeresEngine::ifEntityActions = typename std::enable_if< areEntityActions< As... >, T >::type
 If the types As are all actions (as defined by areActions<As>), this type is aliased to T.
 

Functions

template<CEntityAction A>
constexpr void CeresEngine::checkAction ()
 A trait that checks if the type A is a valid action type.
 

Variables

template<typename A >
constexpr bool CeresEngine::isEntityAction = std::is_base_of<AbstractEntityAction, A>::value
 A trait that checks if the type C is a action.
 
template<typename... As>
constexpr bool CeresEngine::areEntityActions = (isEntityAction<As> && ...)
 A trait that checks if the types As are all actions.
 

Macro Definition Documentation

◆ CE_EXTERN_ENTITY_ACTION

#define CE_EXTERN_ENTITY_ACTION (   T)    CE_EXTERN_ENTITY_ACTION_BASE(T, extern)

◆ CE_EXTERN_ENTITY_ACTION_BASE

#define CE_EXTERN_ENTITY_ACTION_BASE (   T,
  EXTERN 
)
Value:
EXTERN template struct ::CeresEngine::EntityAction<T>; \
EXTERN template class ::CeresEngine::TEntityActionType<T>; \
EXTERN template const ::CeresEngine::EntityActionType& ::CeresEngine::EntityActionType::get<T>() noexcept;

◆ CE_EXTERN_ENTITY_ACTION_IMPL

#define CE_EXTERN_ENTITY_ACTION_IMPL (   T)    CE_EXTERN_ENTITY_ACTION_BASE(T, )