GameObjectLifecycleSystem.ixx File
System that processes health depletion events and triggers despawning. More...
Included Headers
#include <vector>
#include <cassert>
#include <helios.engine.mechanics.match.events>
#include <helios.engine.mechanics.spawn.components.SpawnedByProfileComponent>
#include <helios.engine.mechanics.health.types>
#include <helios.engine.mechanics.match.components>
#include <helios.engine.mechanics.health.events>
#include <helios.engine.runtime.spawn>
#include <helios.engine.runtime.world.UpdateContext>
#include <helios.engine.mechanics.health>
#include <helios.engine.runtime.world.GameWorld>
#include <helios.engine.runtime.world.Manager>
#include <helios.engine.runtime.messaging.command.EngineCommandBuffer>
#include <helios.engine.common.tags.SystemRole>
#include <helios.engine.state.Bindings>
Namespaces Index
| namespace | helios |
| namespace | engine |
|
Main engine module aggregating core infrastructure and game systems. More... | |
| namespace | mechanics |
|
High-level gameplay systems and components for game logic. More... | |
| namespace | lifecycle |
|
Lifecycle management for entity components and world-level operations. More... | |
| namespace | systems |
|
Systems for processing entity lifecycle transitions. More... | |
Classes Index
| class | GameObjectLifecycleSystem |
|
Reacts to HealthDepletedEvents and despawns or deactivates entities. More... | |
Description
System that processes health depletion events and triggers despawning.
File Listing
The file content with the documentation metadata removed is:
34using namespace helios::engine::runtime::world;
35using namespace helios::engine::runtime::messaging::command;
37using namespace helios::engine::mechanics::match::components;
38using namespace helios::engine::mechanics::match::events;
39using namespace helios::engine::mechanics::health::types;
40using namespace helios::engine::mechanics::health::events;
41using namespace helios::engine::mechanics::spawn::components;
42using namespace helios::engine::runtime::spawn::commands;
46export namespace helios::engine::mechanics::lifecycle::systems {
57 class GameObjectLifecycleSystem {
68 void update(helios::engine::runtime::world::UpdateContext& updateContext) noexcept {
70 auto events = updateContext.readPass<HealthDepletedEvent>();
73 auto go = updateContext.find(event.source());
77 auto* hc = go->get<helios::engine::mechanics::health::components::HealthComponent>();
80 if (hasHealthDepletedFlag(healthDepletedBehavior, HealthDepletedBehavior::Despawn)) {
81 if (auto* sbp = go->get<SpawnedByProfileComponent>()) {
83 updateContext.queueCommand<DespawnCommand>(go->entityHandle(), sbp->spawnProfileId());
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.