Provides methods to construct and modify entities within the ECS world.
More...
#include <vecs.h>
|
| EntityBuilder ()=delete |
| Deleted default constructor to prevent creating an EntityBuilder without parameters.
|
|
template<typename... Components> |
bool | has () const |
| Checks if the entity has all specified components.
|
|
| operator Entity () |
| Implicit conversion to Entity type.
|
|
void | despawn () |
|
template<typename... Components> |
EntityBuilder & | insert (Components &&... components) |
| Inserts components into the entity.
|
|
template<typename Component > |
EntityBuilder & | remove () |
|
template<typename Func > |
EntityBuilder & | with_children (Func &&func) |
| Spawns a new entity, allows modifications via a function, and assigns it as a child of the current entity.
|
|
EntityBuilder & | add_child (Entity entity) |
| Adds an existing entity as a child of the current entity.
|
|
template<typename... Components> |
EntityBuilder & | insert_child (Components &&... components) |
| Spawns a new entity, inserts components, and assigns it as a child of the current entity.
|
|
|
class | World |
|
class | EntityCommands |
|
Provides methods to construct and modify entities within the ECS world.
◆ add_child()
Adds an existing entity as a child of the current entity.
- Parameters
-
entity | The entity to be added as a child. |
- Returns
- Reference to the EntityBuilder for chaining operations.
◆ has()
template<typename... Components>
bool vecs::EntityBuilder::has |
( |
| ) |
const |
|
inline |
Checks if the entity has all specified components.
- Template Parameters
-
Components | The types of components to check for. |
- Returns
- True if the entity has all the specified components, otherwise false.
◆ insert()
template<typename... Components>
EntityBuilder & vecs::EntityBuilder::insert |
( |
Components &&... | components | ) |
|
|
inline |
Inserts components into the entity.
- Template Parameters
-
Components | The types of components to insert. |
- Parameters
-
components | Components to insert into the entity. |
- Returns
- Reference to the EntityBuilder for chaining operations.
◆ insert_child()
template<typename... Components>
EntityBuilder & vecs::EntityBuilder::insert_child |
( |
Components &&... | components | ) |
|
|
inline |
Spawns a new entity, inserts components, and assigns it as a child of the current entity.
- Template Parameters
-
Components | The types of components to insert into the new entity. |
- Parameters
-
components | Components to insert into the new entity. |
- Returns
- Reference to the EntityBuilder for chaining operations.
◆ operator Entity()
vecs::EntityBuilder::operator Entity |
( |
| ) |
|
|
inline |
Implicit conversion to Entity type.
- Returns
- The entity ID associated with this EntityBuilder.
◆ with_children()
template<typename Func >
EntityBuilder & vecs::EntityBuilder::with_children |
( |
Func && | func | ) |
|
|
inline |
Spawns a new entity, allows modifications via a function, and assigns it as a child of the current entity.
- Template Parameters
-
Func | The type of the function that modifies the child entity. |
- Parameters
-
func | Function that takes an EntityBuilder for modifying the child entity. |
- Returns
- Reference to the EntityBuilder for chaining operations.
The documentation for this class was generated from the following file: