Entity

a container for components

Constructors

this
this(EntityManager manager)

create entity given the ecs

Members

Functions

add_component
T add_component()

add an instance of a component given the type

add_component
T add_component(T component)

add a component

destroy
void destroy()

release all resources and deinitialize

get_all_components
Component[] get_all_components()

gets all components attached to this entity

get_component
T get_component()

gets a matching component given a type

get_components
T[] get_components()

gets all matching components given a type

has_component
bool has_component()

checks whether this entity contains a matching component

initialize
void initialize()

prepare the instance as a fresh entity

remove_component
void remove_component()

remove a matching component given a type

remove_component
void remove_component(T component)

remove a specific component

toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

position
Vector3 position [@property getter]

forwards to transform

position
Vector3 position [@property setter]

forwards to transform

position2
Vector2 position2 [@property getter]

forwards to transform

position2
Vector2 position2 [@property setter]

forwards to transform

Variables

alive
bool alive;

whether this entity is alive

components
ComponentId[] components;

list of component references

id
size_t id;

the unique id of this entity

manager
EntityManager manager;

ecs manager

name
string name;

friendly name

scene
Scene scene;

the scene that this entity is part of

transform
Transform transform;

world transform of entity

Meta