🔥 Health Mutation¶
📦 Folder Overview¶
This folder defines the minimal mutation surface for applying damage.
It exists so systems can interact with Health without depending on concrete implementations like HealthSystem.
🎯 Purpose¶
IHealthMutator provides:
- A runtime-safe entry point for damage
- A minimal event surface for lifecycle awareness
- A way to decouple gameplay systems from implementation details
🧩 What Lives Here¶
IHealthMutator¶
Provides:
DamageResult ApplyDamage(in DamageContext ctx)event Action Diedevent Action Revived
⚠️ Important Notes¶
Semantics¶
ApplyDamageruns through the damage evaluation pipeline-
The returned
DamageResultreflects: -
whether damage applied
- final applied amount
- rejection reason (if any)
Events:
Died→ raised when health enters a dead stateRevived→ raised when health transitions back to alive
Boundaries¶
IHealthMutator does not:
- expose healing APIs
- provide direct state mutation (use
IHealthWriter) - expose lifecycle control (use
IHealthLifecycle) - expose internal pipeline behaviour
🧠 Usage Guidance¶
Prefer:
IHealthMutator→ for damage applicationIHealable→ for simple healingIHealthWriter→ for direct mutationIHealthLifecycle→ for revive/death control
🔗 Related Documentation¶
- Core Interfaces
- Contracts
- Lifecycle
- Rules