Midnight Blue Game and Engine
Public Member Functions | Properties | List of all members
MB2D.EntityComponent.Entity Class Reference

Represents a tagged and id'd container for components that can be operated on by systems. More...

Collaboration diagram for MB2D.EntityComponent.Entity:
Collaboration graph

Public Member Functions

 Entity (EntityMap container, string tag="")
 Initializes a new instance of the T:MB2D.EntityComponent.Entity class. More...
 
IComponent Attach< T > (params object[] args)
 Attaches a new component to the entity. More...
 
void Attach (IComponent component)
 Attaches a new component to the entity. More...
 
void Detach< T > ()
 Detatches a specific component from the entity More...
 
void DetachAll ()
 Detachs all of the entities attached components. More...
 
GetComponent< T > ()
 Queries the entity to see if it has a component attached and returns it if it does More...
 
bool HasComponent< T > ()
 Checks if an entity has a specific component attached More...
 

Properties

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...
 

Detailed Description

Represents a tagged and id'd container for components that can be operated on by systems.

Constructor & Destructor Documentation

§ Entity()

MB2D.EntityComponent.Entity.Entity ( EntityMap  container,
string  tag = "" 
)
inline

Initializes a new instance of the T:MB2D.EntityComponent.Entity class.

Parameters
containerThe entities parent EntityMap
tagTagname to give the entity

Member Function Documentation

§ Attach()

void MB2D.EntityComponent.Entity.Attach ( IComponent  component)
inline

Attaches a new component to the entity.

Parameters
componentPre constructed component to add
Here is the call graph for this function:
Here is the caller graph for this function:

§ Attach< T >()

IComponent MB2D.EntityComponent.Entity.Attach< T > ( params object []  args)
inline

Attaches a new component to the entity.

Parameters
argsThe components constructor arguments
Template Parameters
TType of component to attach
Type Constraints
T :IComponent 
Here is the call graph for this function:

§ Detach< T >()

void MB2D.EntityComponent.Entity.Detach< T > ( )
inline

Detatches a specific component from the entity

Template Parameters
TThe type of component to detatch.
Type Constraints
T :IComponent 
Here is the call graph for this function:

§ DetachAll()

void MB2D.EntityComponent.Entity.DetachAll ( )
inline

Detachs all of the entities attached components.

Here is the call graph for this function:
Here is the caller graph for this function:

§ 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
TComponent to query the entity for.
Type Constraints
T :IComponent 

§ 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
TThe type of component to check.
Type Constraints
T :IComponent 

Property Documentation

§ 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: