DelayedComponentEnablerSystem.ixx File
System that processes delayed component activations. More...
Included Headers
#include <vector>
#include <helios.engine.runtime.world.tags.SystemRole>
#include <helios.ecs.ComponentOpsRegistry>
#include <helios.ecs.types.ComponentTypeId>
#include <helios.engine.runtime.lifecycle.components.DelayedComponentEnabler>
#include <helios.engine.runtime.world.UpdateContext>
#include <helios.ecs.components.Active>
#include <helios.engine.runtime.world.GameWorld>
Namespaces Index
| namespace | helios |
| namespace | engine |
| namespace | runtime |
| namespace | lifecycle |
| namespace | systems |
Classes Index
| class | DelayedComponentEnablerSystem<THandle> |
|
System that processes delayed component activations each frame. More... | |
Description
System that processes delayed component activations.
File Listing
The file content with the documentation metadata removed is:
24export namespace helios::engine::runtime::lifecycle::systems {
44 class DelayedComponentEnablerSystem {
65 void update(helios::engine::runtime::world::UpdateContext& updateContext) noexcept {
67 const float delta = updateContext.deltaTime();
69 for (auto [entity, dce, active] : updateContext.view<
70 THandle,
73 >().whereEnabled()) {
77 auto deferredComponents = dce->deferredComponents();
79 for (auto& deferredComponent : deferredComponents) {
81 deferredComponent.delta = std::max(deferredComponent.delta - delta, 0.0f);
83 const auto componentTypeId = deferredComponent.componentTypeId;
85 if (deferredComponent.delta <= 0) {
87 auto ops = helios::ecs::ComponentOpsRegistry<THandle>::ops(componentTypeId);
97 dce->sync(sync_);
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.