25template <
typename COMPONENT>
62template <
typename COMPONENT_TYPE>
97 this->
fieldNames = (
const char**)T::Traits::field_names;
134template <
typename COMPONENT>
142 "Component '%s' is not registered! Make sure you call Game::RegisterComponent<T>() for all component types before "
144 COMPONENT::Traits::name
ComponentDecayFunc Decay
Definition component.h:105
const size_t * fieldByteOffsets
Definition component.h:121
const char * GetNamespace() const
Definition component.h:108
const char * fullyQualifiedName
Definition component.h:118
void(*)(Game::World *, Game::Entity, void *) ComponentDecayFunc
Definition component.h:103
const char * GetFullyQualifiedName() const
Definition component.h:109
const char ** GetFieldNames() const
Definition component.h:110
const char ** fieldNames
Definition component.h:119
const char ** GetFieldTypenames() const
Definition component.h:111
const char * componentName
Definition component.h:116
const char ** fieldTypenames
Definition component.h:120
void(*)(Game::World *, Game::Entity, void *) ComponentInitFunc
Definition component.h:102
const size_t * GetFieldByteOffsets() const
Definition component.h:112
const char * namespaceName
Definition component.h:117
ComponentInitFunc Init
Definition component.h:104
size_t numFields
Definition component.h:122
ComponentInterface(Util::StringAtom name, T const &defaultValue, uint32_t flags)
construct from template type, with default value.
Definition component.h:90
const char * GetName() const
Definition component.h:107
size_t const GetNumFields() const
Definition component.h:113
A container of entities, their components, and processors.
Definition world.h:92
Definition attribute.h:29
Util::StringAtom name
name of attribute
Definition attribute.h:49
Attribute(Util::StringAtom name, T const &defaultValue, uint32_t flags)
construct from template type, with default value.
Definition attribute.h:62
static AttributeId GetAttributeId(Util::StringAtom name)
get attribute id from name
Definition attributeregistry.h:213
static bool IsRegistered()
Check if a type is registered.
Definition attributeregistry.h:80
A StringAtom.
Definition stringatom.h:22
void __cdecl n_error(const char *msg,...)
This function is called when a serious situation is encountered which requires abortion of the applic...
Definition debug.cc:138
Game::EditorState.
Definition graphicsmanager.h:66
MemDb::AttributeId ComponentId
Definition componentid.h:15
ComponentFlags
Specifies special behaviour for a components.
Definition component.h:33
@ COMPONENTFLAG_NONE
regular component
Definition component.h:35
@ COMPONENTFLAG_DECAY
Component will decay.
Definition component.h:38
@ COMPONENTFLAG_RUNTIME
Component only holds state of a running world, like handles to what a manager created for the entity.
Definition component.h:41
ComponentId GetComponentId(Util::StringAtom name)
Returns a component id.
Definition component.h:155
AttributeId GetAttributeId()
Definition attributeregistry.h:67
Contains data for components flagged with COMPONENTFLAG_DECAY, that has been deleted this frame.
Definition component.h:50
uint32_t capacity
Definition component.h:52
void * buffer
Definition component.h:53
uint32_t size
Definition component.h:51
Used for registering component types to the game world.
Definition component.h:64
OnInitFunc OnInit
initialization function to run for the component, or nullptr if not needed.
Definition component.h:73
OnDecayFunc OnDecay
function to run when the component is removed from a live entity, or when the entity is deleted.
Definition component.h:78
bool runtime
Set to true if the component only holds state of a running world, it is left out when levels are save...
Definition component.h:71
void(*)(Game::World *, Game::Entity, COMPONENT_TYPE *) OnDecayFunc
Definition component.h:66
bool decay
Set to true if the component should end up in the decay buffer before being completely destroyed.
Definition component.h:69
void(*)(Game::World *, Game::Entity, COMPONENT_TYPE *) OnInitFunc
Definition component.h:65
An entity is essentially just an Id with some utility functions attached.
Definition entity.h:35