vecs
Fast, flexible ecs in C++ with ergonomic API
|
Provides a deferred command interface to manage entity operations within the ECS world. More...
#include <vecs.h>
Public Member Functions | |
Commands (World &world) | |
Commands (const Commands &)=delete | |
Commands & | operator= (const Commands &)=delete |
Commands (Commands &&) noexcept=default | |
Commands & | operator= (Commands &&) noexcept=delete |
template<typename Func > | |
void | add (Func &&func) |
Adds a deferred command to be executed on the world. | |
EntityCommands | spawn () |
Spawns a new entity and provides a deferred interface to add components to it. | |
EntityCommands | entity (Entity entity) |
Provides an EntityCommands interface to manage commands for an existing entity. | |
Friends | |
class | World |
Provides a deferred command interface to manage entity operations within the ECS world.
The Commands class allows spawning entities, adding entity-specific commands, and scheduling deferred world operations to be executed later.
|
inline |
Adds a deferred command to be executed on the world.
func | The function representing a world-level operation to defer. |
|
inline |
Provides an EntityCommands
interface to manage commands for an existing entity.
This method retrieves an existing entity and queues commands to modify its state, returning an EntityCommands
instance to add specific deferred commands for that entity.
entity | The entity to be managed by deferred commands. |
EntityCommands
instance for the specified entity.
|
inline |
Spawns a new entity and provides a deferred interface to add components to it.
This method creates a new entity in the ECS and returns an EntityCommands
instance to allow deferred commands for that specific entity.
EntityCommands
instance for managing deferred commands on the newly spawned entity.