Cogs.Core
Public Attributes | List of all members
Cogs::Core::EntityDefinition Struct Reference

Defines how to construct entities of a certain type by a list of components to instantiate and default values to apply to fields in these components. More...

#include <EntityDefinition.h>

Public Attributes

std::string name
 
std::string description
 Description of the entity. For in-line documentation.
 
std::vector< std::string > components
 Names of the component types to instantiate when creating an entity from this definition.
 
bool compiled = false
 
std::vector< ComponentCreator * > creators
 
std::vector< FieldValuedefaultValues
 Set of default values to apply after constructing entities from this definition.
 

Detailed Description

Defines how to construct entities of a certain type by a list of components to instantiate and default values to apply to fields in these components.

Definition at line 159 of file EntityDefinition.h.

Member Data Documentation

◆ compiled

bool Cogs::Core::EntityDefinition::compiled = false

If the definition is compiled. Compiled definitions have performed component type name lookup and stored creator functions in creators.

Definition at line 175 of file EntityDefinition.h.

◆ components

std::vector<std::string> Cogs::Core::EntityDefinition::components

◆ creators

std::vector<ComponentCreator *> Cogs::Core::EntityDefinition::creators

Creator functions to call when constructing an entity from this definition. All creators will return component handles, which can then be added to the entity.

Definition at line 179 of file EntityDefinition.h.

◆ defaultValues

std::vector<FieldValue> Cogs::Core::EntityDefinition::defaultValues

Set of default values to apply after constructing entities from this definition.

Definition at line 182 of file EntityDefinition.h.

◆ description

std::string Cogs::Core::EntityDefinition::description

Description of the entity. For in-line documentation.

Definition at line 168 of file EntityDefinition.h.

◆ name

std::string Cogs::Core::EntityDefinition::name

Name of the entity. This is used to uniquely identify an entity class and instantiate from this class making sure contained components and behavior of the entities of a given class are the same.

Definition at line 165 of file EntityDefinition.h.

Referenced by Cogs::Core::EntityStore::addEntityDefinition(), Cogs::Core::createEntityDefinition(), Cogs::Core::CurtainView::CurtainViewExtension::initialize(), Cogs::Core::VectorField::VectorFieldExtension::initialize(), Cogs::VideoExtension::VideoExtension::initialize(), and Cogs::Core::writeEntity().


The documentation for this struct was generated from the following file: