Skip to main content

commands Folder

Files Index

filehelios/engine/mechanics/damage/commands/_module.ixx

Aggregate module for damage commands. More...

fileApplyDamageCommand.ixx

Command for requesting damage application to an entity. More...

Description

helios::engine::mechanics::damage::commands

Damage-related commands for the command buffer.

This namespace contains command classes used to request damage application through the engine's command system.

Commands

CommandDescription
ApplyDamageCommandCarries a DamageContext to request damage application to a target entity

Usage

Commands are typically issued by DamageOnCollisionSystem when a collision between damageable entities is detected:

 auto ctx = DamageContext{
  .interactionContext = {
  .target = targetHandle,
  .instigator = instigatorHandle,
  .causer = causerHandle,
  .contact = contactPoint
  },
  .damage = 10.0f
 };
 
 updateContext.commandBuffer().add<ApplyDamageCommand>(ctx);

The command is routed to HealthManager via its TypedCommandHandler<ApplyDamageCommand> interface and processed during the manager flush phase.



Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.