ECS¶
Inherits: Node
A singleton for managing the simple Entity Component System for Godot.
Description¶
This framework does not try to add a lot of functionality, instead it tries to provide a low level API for managing objects for an ECS like environment.
Inherits: Node
Properties¶
Methods¶
| void | add_component ( Component component ) |
| void | add_entity ( Entity entity ) |
| void | add_group ( Group group ) |
| void | add_system ( System system ) |
| void | clean ( ) |
| void | entity_add_component ( Entity entity, Component component ) |
| Component | entity_get_component ( Entity entity, String name ) |
| bool | entity_has_component ( Entity entity, String name ) |
| void | entity_remove_component ( Entity entity, String name ) |
| Dictionary | get_all_components ( ) |
| Component | get_component ( String name ) |
| bool | has_component ( String name ) |
| bool | has_entity ( String name ) |
| bool | has_group ( String name ) |
| bool | has_system ( String name ) |
| void | rebuild ( ) |
| void | remove_component ( String name ) |
| void | remove_entity ( String name ) |
| void | remove_group ( String name ) |
| void | remove_system ( String name ) |
| void | update ( String group = null, float delta = null ) |
Property Descriptions¶
- Dictionary entities
A list containing all the entities that have been registered.
- Dictionary component_entities
A list containing all the entities with a component that have been registered.
- Dictionary systems
A list containing all the systems that have been registered.
- Dictionary system_components
A list containing all the components in a system that have been registered.
- Dictionary system_entities
A list containing all the entities in a system.
- Dictionary groups
A list containing all the groups in the framework.
- Dictionary group_systems
A list of systems in a group.
- Dictionary entity_remove_queue
A list of entities to remove after all systems have completed running.
- bool is_dirty
Returns true when the framework needs to be cleaned up. This usually occurs when any objects have been added or removed in the framework. You can set this property to true at any time to force a rebuild of the systems.
Method Descriptions¶
- void add_component ( Component component )
Adds a Component to the framework. If the component already exists, it will not be added again.
- void add_entity ( Entity entity )
Adds an Entity to the framework. If the entity has already been added, it will not be added again.
- void add_group ( Group system )
Adds a Group to the framework. If the group has already been added, it will not be added again.
- void add_system ( System system )
Adds a System to the framework. If the system has already been added, it will not be added again.
- void clean ( )
Removes all odbjects from the framework.
For a given Entity, add a Component to it.
For a given Entity, return a Component from it based on the name given.
For a given Entity, returns true if the named component is available.
For a given Entity, remove the named component.
- Dictionary get_all_components ( )
Returns all components in the framework.
Returns a Component from the framework in name
Returns true if the Component in name exists.
Returns true if the Entity in name exists.
Returns true if the Group in name exists.
Returns true if the System in name exists.
- bool rebuild ( )
Rebuild the system_entities.
- void remove_component ( String name )
Rmoves the Component from the framework in name.
- void remove_entity ( String name )
Rmoves the Entity from the framework in name.
- void remove_group ( String name )
Rmoves the Group from the framework in name.
- void remove_system ( String name )
Rmoves the System from the framework in name.
Update the systems in the framework. A Group may be specified in addition to a delta.