The entity traits struct gathers types to be used for specializing an entity.
More...
#include <entity.hh>
|
using | State = StateType |
| Type of the entitys' state container. More...
|
|
using | Tags = EntityTags |
| Custom entity tags. More...
|
|
template<class EntityContainerType > |
using | CustomLinks = CustomLinkContainers< EntityContainerType > |
| Template template parameter to specify type of custom links. More...
|
|
template<typename StateType, Update update_mode, bool use_def_state_constr = false, typename EntityTags = EmptyTag, template< class > class CustomLinkContainers = NoCustomLinks>
struct Utopia::EntityTraits< StateType, update_mode, use_def_state_constr, EntityTags, CustomLinkContainers >
The entity traits struct gathers types to be used for specializing an entity.
- Template Parameters
-
StateType | Type of the entitys' state container |
update_mode | The update mode of the entities. Use Update::manual for choosing the update mode flexibly when calling apply_rule. |
use_def_state_constr | Whether to use the default constructor to construct the entity's state. If false (default), a constructor with DataIO::Config& as argument has to be implemented for StateType. |
Tags | Custom entity tags |
CustomLinkContainers | Template template parameter to specify the types of custom links. This construct is specialized with the actual type of the entity container by the EntityManager, so there's no need to know the entity container type beforehand. To define your own custom links, pass a template to a struct whose members are containers of the objects you want to link to. |
◆ CustomLinks
template<typename StateType , Update update_mode, bool use_def_state_constr = false, typename EntityTags = EmptyTag, template< class > class CustomLinkContainers = NoCustomLinks>
template<class EntityContainerType >
using Utopia::EntityTraits< StateType, update_mode, use_def_state_constr, EntityTags, CustomLinkContainers >::CustomLinks = CustomLinkContainers<EntityContainerType> |
Template template parameter to specify type of custom links.
◆ State
template<typename StateType , Update update_mode, bool use_def_state_constr = false, typename EntityTags = EmptyTag, template< class > class CustomLinkContainers = NoCustomLinks>
using Utopia::EntityTraits< StateType, update_mode, use_def_state_constr, EntityTags, CustomLinkContainers >::State = StateType |
Type of the entitys' state container.
◆ Tags
template<typename StateType , Update update_mode, bool use_def_state_constr = false, typename EntityTags = EmptyTag, template< class > class CustomLinkContainers = NoCustomLinks>
using Utopia::EntityTraits< StateType, update_mode, use_def_state_constr, EntityTags, CustomLinkContainers >::Tags = EntityTags |
◆ mode
template<typename StateType , Update update_mode, bool use_def_state_constr = false, typename EntityTags = EmptyTag, template< class > class CustomLinkContainers = NoCustomLinks>
constexpr Update Utopia::EntityTraits< StateType, update_mode, use_def_state_constr, EntityTags, CustomLinkContainers >::mode = update_mode |
|
staticconstexpr |
Whether the entitys should be synchronously updated.
◆ use_default_state_constructor
template<typename StateType , Update update_mode, bool use_def_state_constr = false, typename EntityTags = EmptyTag, template< class > class CustomLinkContainers = NoCustomLinks>
constexpr bool Utopia::EntityTraits< StateType, update_mode, use_def_state_constr, EntityTags, CustomLinkContainers >::use_default_state_constructor = use_def_state_constr |
|
staticconstexpr |
Whether to use the default constructor for constructing a entity state.
The documentation for this struct was generated from the following file: