HealthManager.ixx File
Manager for processing damage commands and emitting health events. More...
Included Headers
#include <vector>
#include <helios.util.log>
#include <helios.engine.mechanics.lifecycle.components>
#include <helios.engine.mechanics.health.events>
#include <helios.engine.mechanics.health.types>
#include <helios.engine.common.types>
#include <helios.engine.mechanics.damage.commands.ApplyDamageCommand>
#include <helios.engine.common.tags>
#include <helios.engine.mechanics.health.components.HealthComponent>
#include <helios.engine.runtime.world.UpdateContext>
#include <helios.engine.mechanics.damage.components.LastDamageComponent>
#include <helios.engine.runtime.world.GameWorld>
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 | health |
|
Health management system for game entities. More... | |
Classes Index
| class | HealthManager |
|
Manager that processes damage commands and updates entity health. More... | |
Macro Definitions Index
| #define | HELIOS_LOG_SCOPE "helios::engine::mechanics::health::HealthManager" |
Description
Manager for processing damage commands and emitting health events.
Macro Definitions
HELIOS_LOG_SCOPE
|
Definition at line 38 of file HealthManager.ixx.
38#define HELIOS_LOG_SCOPE "helios::engine::mechanics::health::HealthManager"
File Listing
The file content with the documentation metadata removed is:
28using namespace helios::engine::mechanics::health::types;
29using namespace helios::engine::mechanics::health::components;
30using namespace helios::engine::mechanics::health::events;
31using namespace helios::engine::mechanics::lifecycle::components;
32using namespace helios::engine::common::types;
33using namespace helios::engine::mechanics::damage::components;
34using namespace helios::engine::mechanics::damage::commands;
35using namespace helios::engine::runtime::messaging::command;
36using namespace helios::engine::runtime::world;
38#define HELIOS_LOG_SCOPE "helios::engine::mechanics::health::HealthManager"
39export namespace helios::engine::mechanics::health {
64 class HealthManager {
69 inline static const helios::util::log::Logger& logger_ = helios::util::log::LogManager::loggerForScope(
70 HELIOS_LOG_SCOPE);
95 void flush(UpdateContext& updateContext) noexcept {
103 auto* hc = target->get<HealthComponent>();
108 bool wasAlive = hc->isAlive();
112 auto* lac = target->get<LastDamageComponent>();
117 auto huc = HealthChangeContext{
122 updateContext.pushPhase<HealthChangedEvent>(huc);
127 if (hasHealthDepletedFlag(healthDepletedBehavior, HealthDepletedBehavior::DeadTag)) {
128 target->add<DeadTagComponent>();
131 updateContext.pushPass<HealthDepletedEvent>(target->entityHandle(), damageContext);
146 const ApplyDamageCommand applyDamageCommand
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.