ECSManager Reference - NocturnalWisp/Tynted-Engine GitHub Wiki
The ECSManager is useful for handling various management practices across a game.
These are used for adding or removing systems and components.
Summary
Adds a system to be run by the manager.
Implementation
AddSystem<T>() where T : SystemVars
- T - System Type
Summary
Removes a system from the manager.
Implementation
RemoveSystem<T>() where T : SystemVars
- T - System Type
Summary
Adds a component to be held by the manager.
Implementation
AddComponent<T>() where T : IComponentVars
- T - IComponent Type
Summary
Removes a component from the manager.
Implementation
RemoveComponent<T>() where T : IComponentVars
- T - System Type
Used to alter entities and their components.
Summary
Returns a list of all the entity components of a type that are active.
Implementation
GetComponentEntityActiveList<T>() where T : IComponentVars
- T - Component Type
Returns
- List - Entity components of type T.
Summary
Returns a list of all the entity components of a type.
Implementation
GetComponentEntityList<T>() where T : IComponentVars
- T - Component type.
Returns
- List - Entity components of type T.
Summary
Creates an entity.
Implementation
CreateEntity(string name, string tag = "Default", string scene = "")Vars
- name - Name of the entity.
- tag - Tag of the new entity.
- scene - Name of the scene of the entity.
Returns
- int? - entityID if created.
Summary
Deletes an entity.
Implementation
DeleteEntity(string name, string tag = "Default", string scene = "")Vars
- name - Name of the entity.
- tag - Tag of the entity.
- scene - Name of the scene of the entity.
Summary
Adds the component to the entity.
Implementation
AddEntityComponent(string entityName, IComponent component)Vars
- entityName - Name of the entity.
- component - The component to add to the entity.
Summary
Adds multiple components to entities.
Implementation
RegisterEntityComponents(params EntityComponentIdentifier[] entityComponents)Vars
- entityComponents - Array of EntityComponentIdentifier that add components to entities.
Summary
Removes a component from an entity.
Implementation
RemoveEntityComponent<T>(string entityName) where T : IComponentVars
- T - Component type.
- entityName - Name of the entity.
Summary
Returns the component of an entity.
Implementation
GetEntityComponent<T>(string entityName) where T : IComponentVars
- T - Component type.
- entityName - Name of the entity.
Returns
- IComponent - The component if found.
Summary
Adds the component to the entity.
Implementation
RemoveAllEntityComponents(string entityName)Vars
- entityName - Name of the entity to remove components from.
Summary
Returns all the components an entity has.
Implementation
GetEntityComponents(string entityName)Vars
- entityName - Name of the entity.
Returns
- List - All the components on the entity.
These help to create and control events for systems.
Summary
Creates a new event without any arguments.
Implementation
CreateEvent(string name)Vars
- name - The name of the event to create.
Returns
- TyntedEvent - The event if created.
Summary
Creates a new event with one argument.
Implementation
CreateEvent1Arg(string name)Vars
- name - The name of the event to create.
Returns
- TyntedEvent - The event if created.
Summary
Creates a new event with two arguments.
Implementation
CreateEvent2Arg(string name)Vars
- name - The name of the event to create.
Returns
- TyntedEvent<object, object> - The event if created.
Summary
Subscribes to an event without any arguments.
Implementation
SubscribeEvent(string name, EngineAction action)Vars
- name - The name of the event subscribe to.
- action - The action to call when the event is invoked.
Summary
Subscribes to an event with one argument.
Implementation
SubscribeEvent(string name, EngineAction<object> action)Vars
- name - The name of the event subscribe to.
- action - The action to call when the event is invoked.
Summary
Subscribes to an event with two arguments.
Implementation
SubscribeEvent(string name, EngineAction<object, object> action)Vars
- name - The name of the event subscribe to.
- action - The action to call when the event is invoked.
Summary
Un-Subscribes from an event without any arguments.
Implementation
UnSubscribeEvent(string name, EngineAction action)Vars
- name - The name of the event un-subscribe from.
- action - The action to remove the event caller from.
Summary
Un-Subscribes from an event with one argument.
Implementation
UnSubscribeEvent(string name, EngineAction<object> action)Vars
- name - The name of the event un-subscribe from.
- action - The action to remove the event caller from.
Summary
Un-Subscribes from an event with two arguments.
Implementation
UnSubscribeEvent(string name, EngineAction<object, object> action)Vars
- name - The name of the event un-subscribe from.
- action - The action to remove the event caller from.