CombatScoringSystem.ixx File
System that awards scores based on combat events. More...
Included Headers
#include <algorithm>
#include <cassert>
#include <cmath>
#include <format>
#include <helios/helios_config.h>
#include <unordered_set>
#include <vector>
#include <helios.engine.common.tags.SystemRole>
#include <helios.util.log>
#include <helios.engine.modules.physics.collision.events>
#include <helios.engine.mechanics.health.events.HealthDepletedEvent>
#include <helios.engine.runtime.messaging.command.EngineCommandBuffer>
#include <helios.engine.ecs.types.EntityId>
#include <helios.engine.state.Bindings>
#include <helios.engine.runtime.world.UpdateContext>
#include <helios.engine.runtime.world.GameWorld>
#include <helios.engine.mechanics.scoring.types>
#include <helios.engine.mechanics.scoring.components>
#include <helios.engine.mechanics.scoring.commands>
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 | scoring |
|
Score management and tracking system for game mechanics. More... | |
| namespace | systems |
|
Systems for score processing and observation. More... | |
Classes Index
| class | CombatScoringSystem |
|
System that processes death events and awards scores. More... | |
Macro Definitions Index
| #define | HELIOS_LOG_SCOPE "helios::engine::mechanics::scoring::systems::CombatScoringSystem" |
Description
System that awards scores based on combat events.
Macro Definitions
HELIOS_LOG_SCOPE
|
Definition at line 46 of file CombatScoringSystem.ixx.
46#define HELIOS_LOG_SCOPE "helios::engine::mechanics::scoring::systems::CombatScoringSystem"
File Listing
The file content with the documentation metadata removed is:
40using namespace helios::engine::mechanics::scoring::components;
41using namespace helios::engine::mechanics::scoring::types;
42using namespace helios::engine::mechanics::scoring::commands;
43using namespace helios::engine::mechanics::health::events;
44using namespace helios::engine::ecs::types;
46#define HELIOS_LOG_SCOPE "helios::engine::mechanics::scoring::systems::CombatScoringSystem"
49export namespace helios::engine::mechanics::scoring::systems {
58 class CombatScoringSystem {
60 inline static const helios::util::log::Logger& logger_ = helios::util::log::LogManager::loggerForScope(
61 HELIOS_LOG_SCOPE);
73 void update(helios::engine::runtime::world::UpdateContext& updateContext) noexcept {
75 for (auto& event : updateContext.readPass<HealthDepletedEvent>()) {
77 if (!event.damageContext()) {
85 const auto enemy = updateContext.find(event.source());
92 auto* svc = enemy->get<ScoreValueComponent<KillReward>>();
97 auto* scc = instigator->get<ScorePoolComponent>();
102 auto scoreContext = ScoreValueContext{
103 .scoreTypeId = ScoreTypeId::id<KillReward>(),
105 .value = svc->score().value()
114 updateContext.queueCommand<UpdateScoreCommand>(
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.