vecs
Fast, flexible ecs in C++ with ergonomic API
|
Provides a deferred command interface for managing a specific entity's state within the ECS world. More...
#include <vecs.h>
Public Member Functions | |
template<typename... Components> | |
EntityCommands & | insert (Components &&... components) |
Adds a deferred command to insert components into the entity. | |
template<typename Component > | |
EntityCommands & | remove () |
operator Entity () | |
EntityCommands & | add_child (Entity entity) |
template<typename... Components> | |
EntityCommands & | insert_child (Components &&... components) |
template<typename Func > | |
EntityCommands & | with_children (Func &&func) |
void | despawn () |
Adds a deferred command to despawn the entity. | |
Friends | |
class | Commands |
Provides a deferred command interface for managing a specific entity's state within the ECS world.
This class enables deferred operations, such as inserting components or despawning an entity.
void vecs::EntityCommands::despawn | ( | ) |
Adds a deferred command to despawn the entity.
This method queues a command that despawns the entity when executed.
EntityCommands & vecs::EntityCommands::insert | ( | Components &&... | components | ) |
Adds a deferred command to insert components into the entity.
This method queues a command that inserts the specified components into the entity when executed.
Components | Variadic template for component types to insert. |
components | The components to insert into the entity. |
EntityCommands
instance for method chaining.