This class is responsible for writing commands to a command_buffer.
More...
#include <command.hpp>
This class is responsible for writing commands to a command_buffer.
Example
auto e = cmd.
create<position>({});
e.set<velocity>({});
static void flush(registry ®istry)
Flushes all commands in the command buffers to the given registry.
Definition command.hpp:27
This class is responsible for writing commands to a command_buffer.
Definition command.hpp:235
Registry is a container for all our entities and components. Components are stored in continuously in...
Definition registry.hpp:13
constexpr auto create(Components &&... args) -> entity_ref
Creates a new entity and attaches the specified components to it.
Definition registry.hpp:39
constexpr auto get_entity(entity ent) noexcept -> entity_ref
Retrieves a mutable reference to an entity.
Definition registry.hpp:51
◆ command_writer()
| co_ecs::command_writer::command_writer |
( |
registry & | reg | ) |
|
|
inline |
Constructs a command_writer with a given registry.
- Parameters
-
| reg | Reference to a registry object. |
◆ create()
template<component... Args>
Creates a new entity with the given components.
- Template Parameters
-
| Args | Component types to be added to the entity. |
- Parameters
-
| args | Components to be added to the entity. |
- Returns
- A reference to the newly created command entity.
◆ destroy()
| void co_ecs::command_writer::destroy |
( |
entity | ent | ) |
|
|
inline |
Destroys an existing entity.
- Parameters
-
| ent | The entity to be destroyed. |
◆ get_entity()
Retrieves a reference to a command entity.
- Parameters
-
| ent | The entity to retrieve. |
- Returns
- A reference to the command entity.
The documentation for this class was generated from the following file: