Class Entity

A world entity consisting of a unique ID and a collection of associated components.

class Entity ;

Constructors

NameDescription
this () Initialize a new empty entity.

Fields

NameTypeDescription
id const(std.uuid.UUID)Unique ID of this entity

Methods

NameDescription
add (component) Add a Component instance to this entity.
add (data, name) Add a new Component given its type and, optionally, a default value and its name
contains (component) Determines whether this Entity contains a given Component instance.
contains (name) Determines whether this Entity contains a NamedComponent instance given its name.
contains (name) Determines whether this Entity contains a Component given its type and, optionally, its name.
get (name) Get Component data given its type and optionally its name.
getMut () Get a mutable reference to Component data given its interface type.
getMut (name) Get a mutable reference to Component data given its type and optionally its name.
hasTag (tag) Detect whether this Entity has the given Tag.
replace (component) Replace a Component given new value.