Maps entities, systems and components to one another and provides querying and updating access to all elements
More...
Maps entities, systems and components to one another and provides querying and updating access to all elements
§ EntityMap() [1/2]
MB2D.EntityComponent.EntityMap.EntityMap |
( |
| ) |
|
|
inline |
Initializes a new instance of the T:MB2D.EntityComponent.EntityMap class.
§ EntityMap() [2/2]
MB2D.EntityComponent.EntityMap.EntityMap |
( |
EntityMap |
map | ) |
|
|
inline |
Initializes a new instance of the T:MB2D.EntityComponent.EntityMap class. Uses an existing EntityMap to copy all registered systems and components as well as any persistant Entities.
- Parameters
-
§ AddComponent()
void MB2D.EntityComponent.EntityMap.AddComponent |
( |
Type |
componentType | ) |
|
|
inline |
Registers a new component type to the EntityMap
- Parameters
-
componentType | Type of component to register |
§ AddComponent< T >()
Registers a new component type to the EntityMap
- Template Parameters
-
T | Type of component to register |
§ AddEntity()
void MB2D.EntityComponent.EntityMap.AddEntity |
( |
Entity |
entity | ) |
|
|
inline |
Adds a created entity to this map
- Parameters
-
§ AddSystem< T >()
void MB2D.EntityComponent.EntityMap.AddSystem< T > |
( |
params object [] |
args | ) |
|
|
inline |
§ Clear()
void MB2D.EntityComponent.EntityMap.Clear |
( |
| ) |
|
|
inline |
Clears all entities from this map except for any marked as persistant.
§ CreateEntity()
Entity MB2D.EntityComponent.EntityMap.CreateEntity |
( |
string |
tag = "" | ) |
|
|
inline |
Creates a new Entity with the given tag in this map. Auto-Registers the entity with all systems and updates its mask.
- Returns
- The created entity
- Parameters
-
tag | Tagname to give the entity |
§ GetComponentID< T >()
ulong MB2D.EntityComponent.EntityMap.GetComponentID< T > |
( |
| ) |
|
|
inline |
Gets the id of a specified component type if it exists.
- Returns
- The component id mask.
- Template Parameters
-
T | Type of component to query for. |
§ GetSystem< T >()
EntitySystem MB2D.EntityComponent.EntityMap.GetSystem< T > |
( |
| ) |
|
|
inline |
Retrieves a pre-registered system from the map
- Returns
- The system if it exists; null otherwise
- Template Parameters
-
T | Type of system to retrieve. |
§ UpdateEntityMask()
void MB2D.EntityComponent.EntityMap.UpdateEntityMask |
( |
Entity |
entity | ) |
|
|
inline |
Updates a specific entities component mask. Use after registering new components or systems.
- Parameters
-
§ UpdateSystems()
void MB2D.EntityComponent.EntityMap.UpdateSystems |
( |
Entity |
entity | ) |
|
|
inline |
Updates each systems associated entity list, adding the specified Entity. Use after creating a new Entity and adding it manually
- Parameters
-
entity | Entity to track in each system |
§ EntityCount
int MB2D.EntityComponent.EntityMap.EntityCount |
|
get |
Gets the number of entities in the map.
The entity count.
§ NextID
ulong MB2D.EntityComponent.EntityMap.NextID |
|
get |
Auto-increments the last generated GUID and retrieves the result
The next identifier.
§ this[string key]
Entity MB2D.EntityComponent.EntityMap.this[string key] |
|
get |
Gets the T:MB2D.EntityComponent.Entity with the specified tag if it exists; null otherwise
- Parameters
-
key | Tagname of the entity to retireve. |
The documentation for this class was generated from the following file:
- MB2D/src/EntityComponent/EntityMap.cs