Represents a tagged and id'd container for components that can be operated on by systems.
More...
|
ulong | Mask [get, set] |
| Gets and sets the entities component mask. More...
|
|
ulong | ID [get, set] |
| Gets and sets the entities Globally Unique ID in the EntityMap More...
|
|
string | Tag [get] |
| Gets this entities tagname More...
|
|
Dictionary< Type, IComponent >.ValueCollection | ComponentList [get] |
| Gets the list if components attached to this entity. More...
|
|
Dictionary< Type, IComponent >.KeyCollection | ComponentTypeList [get] |
| Gets the types of components this entity has attached More...
|
|
bool | Persistent [get, set] |
| Gets or sets a value indicating whether this T:MB2D.EntityComponent.Entity is persistant in its parent T:MB2D.EntityComponent.EntityMap. More...
|
|
bool | Active [get, set] |
| Gets or sets a value indicating whether this T:MB2D.EntityComponent.Entity is active. Inactive entities are skipped over in each EntitySystems Process() method but aren't destroyed. Allowing semi-persistant entities. More...
|
|
Represents a tagged and id'd container for components that can be operated on by systems.
§ Entity()
MB2D.EntityComponent.Entity.Entity |
( |
EntityMap |
container, |
|
|
string |
tag = "" |
|
) |
| |
|
inline |
Initializes a new instance of the T:MB2D.EntityComponent.Entity class.
- Parameters
-
container | The entities parent EntityMap |
tag | Tagname to give the entity |
§ Attach()
void MB2D.EntityComponent.Entity.Attach |
( |
IComponent |
component | ) |
|
|
inline |
Attaches a new component to the entity.
- Parameters
-
component | Pre constructed component to add |
§ Attach< T >()
Attaches a new component to the entity.
- Parameters
-
args | The components constructor arguments |
- Template Parameters
-
T | Type of component to attach |
§ Detach< T >()
void MB2D.EntityComponent.Entity.Detach< T > |
( |
| ) |
|
|
inline |
Detatches a specific component from the entity
- Template Parameters
-
T | The type of component to detatch. |
§ DetachAll()
void MB2D.EntityComponent.Entity.DetachAll |
( |
| ) |
|
|
inline |
Detachs all of the entities attached components.
§ GetComponent< T >()
T MB2D.EntityComponent.Entity.GetComponent< T > |
( |
| ) |
|
|
inline |
Queries the entity to see if it has a component attached and returns it if it does
- Returns
- The component if the entity has it attached, null otherwise
- Template Parameters
-
T | Component to query the entity for. |
§ HasComponent< T >()
bool MB2D.EntityComponent.Entity.HasComponent< T > |
( |
| ) |
|
|
inline |
Checks if an entity has a specific component attached
- Returns
true
, if component is attached, false
otherwise.
- Template Parameters
-
T | The type of component to check. |
§ Active
bool MB2D.EntityComponent.Entity.Active |
|
getset |
Gets or sets a value indicating whether this T:MB2D.EntityComponent.Entity is active. Inactive entities are skipped over in each EntitySystems Process() method but aren't destroyed. Allowing semi-persistant entities.
true
if the entity is active; otherwise, false
.
§ ComponentList
Dictionary<Type, IComponent>.ValueCollection MB2D.EntityComponent.Entity.ComponentList |
|
get |
Gets the list if components attached to this entity.
The component list.
§ ComponentTypeList
Dictionary<Type, IComponent>.KeyCollection MB2D.EntityComponent.Entity.ComponentTypeList |
|
get |
Gets the types of components this entity has attached
The component type list.
§ ID
ulong MB2D.EntityComponent.Entity.ID |
|
getset |
Gets and sets the entities Globally Unique ID in the EntityMap
GUID
§ Mask
ulong MB2D.EntityComponent.Entity.Mask |
|
getset |
Gets and sets the entities component mask.
The component mask.
§ Persistent
bool MB2D.EntityComponent.Entity.Persistent |
|
getset |
Gets or sets a value indicating whether this T:MB2D.EntityComponent.Entity is persistant in its parent T:MB2D.EntityComponent.EntityMap.
true
if persistant; otherwise, false
.
§ Tag
string MB2D.EntityComponent.Entity.Tag |
|
get |
Gets this entities tagname
The tagname
The documentation for this class was generated from the following file:
- MB2D/src/EntityComponent/Entity.cs