Entity.ixx File
High-level facade for entity manipulation in the ECS. More...
Included Headers
#include <cassert>
#include <type_traits>
#include <typeindex>
#include <helios.ecs.types.ComponentTypeId>
#include <helios.ecs.ComponentOpsRegistry>
#include <helios.ecs.components>
#include <helios.ecs.EntityManager>
#include <helios.ecs.types.EntityHandle>
Namespaces Index
| namespace | helios |
| namespace | ecs |
Classes Index
| class | Entity<TEntityManager> |
|
Lightweight facade for entity component manipulation. More... | |
Description
High-level facade for entity manipulation in the ECS.
File Listing
The file content with the documentation metadata removed is:
24using namespace helios::ecs::types;
25export namespace helios::ecs {
97 using Handle_type = TEntityManager::Handle_type;
110 const Handle_type entityHandle,
123 void forEachComponentTypeId(TFunc&& func) const {
132 [[nodiscard]] Handle_type handle() noexcept {
141 [[nodiscard]] Handle_type handle() const noexcept {
172 const auto ops = ComponentOpsRegistry_type::ops(typeId);
173 void* raw = entityManager_->raw(entityHandle_, typeId);
176 ops.onActivate(raw);
178 ops.onDeactivate(raw);
221 void* raw(const ComponentTypeId_type typeId) {
268 bool has(ComponentTypeId_type typeId) const noexcept {
277 void enableComponent(const ComponentTypeId_type typeId) {
286 void disableComponent(const ComponentTypeId_type typeId) {
312 bool isActive = entityManager_->template has<ActiveComponent_type>(entityHandle_);
313 bool isInActive = !isActive;
315 if (!isActive && active) {
334 [&](const ComponentTypeId_type typeId) {
335 const auto& ops = ComponentOpsRegistry_type::ops(typeId);
338 void* raw = entityManager_->raw(entityHandle_, typeId);
339 ops.onActivate(raw);
341 void* raw = entityManager_->raw(entityHandle_, typeId);
342 ops.onDeactivate(raw);
366 [&](const ComponentTypeId_type typeId) {
367 const auto& ops = ComponentOpsRegistry_type::ops(typeId);
370 void* raw = entityManager_->raw(entityHandle_, typeId);
371 ops.onRelease(raw);
387 [&](const ComponentTypeId_type typeId) {
388 const auto& ops = ComponentOpsRegistry_type::ops(typeId);
391 void* raw = entityManager_->raw(entityHandle_, typeId);
392 ops.onAcquire(raw);
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.