engine/ecs/EntityRegistry.ixx File
Defines the EntityRegistry class for managing entity lifecycles. More...
Included Headers
#include <span>
#include <vector>
#include <memory>
#include <helios.engine.common.types.VersionId>
#include <helios.engine.ecs.types>
#include <helios.engine.ecs.EntityHandle>
Namespaces Index
| namespace | helios |
| namespace | engine |
|
Main engine module aggregating core infrastructure and game systems. More... | |
| namespace | ecs |
|
Core Entity-Component-System architecture. More... | |
Classes Index
| class | EntityRegistry |
|
Central registry for creating and managing entity handles. More... | |
Description
Defines the EntityRegistry class for managing entity lifecycles.
File Listing
The file content with the documentation metadata removed is:
19export namespace helios::engine::ecs {
28 constexpr auto InitialVersion = helios::engine::common::types::VersionId{1};
77 class EntityRegistry {
97 EntityRegistry() = default;
107 explicit EntityRegistry(const size_t capacity) {
119 EntityHandle create() {
121 helios::engine::ecs::types::EntityId idx;
126 version = InitialVersion;
128 versions_.push_back(version);
135 version = versions_[idx];
139 return {idx, version};
153 [[nodiscard]] helios::engine::common::types::VersionId version(const helios::engine::ecs::types::EntityId entityId) const {
171 [[nodiscard]] bool isValid(const EntityHandle handle) const noexcept {
194 bool destroy(const EntityHandle handle) {
196 if (!isValid(handle)) {
200 const auto index = handle.entityId;
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.