1.1 KiB
1.1 KiB
Data Model: Inline HP Delta Input
No data model changes
This feature does not modify any domain entities, events, or state transitions. The existing data model fully supports the new UI:
Existing Entities (unchanged)
Combatant
id: CombatantId (branded string)name: stringinitiative?: numbermaxHp?: numbercurrentHp?: number
Encounter
combatants: readonly Combatant[]activeIndex: numberroundNumber: number
Existing Domain Function (unchanged)
adjustHp(encounter, combatantId, delta) -> AdjustHpSuccess | DomainError
- Negative delta = damage, positive delta = heal
- Clamps result to [0, maxHp]
- Emits
CurrentHpAdjustedevent
Existing Domain Event (unchanged)
CurrentHpAdjusted
combatantId: CombatantIdpreviousHp: numbernewHp: numberdelta: number
UI State Changes
The only state change is in the QuickHpInput component:
- Removed:
mode: "damage" | "heal"state variable - Kept:
value: stringstate variable for the input field
The action (damage vs heal) is now determined at invocation time by which button/key triggered it, not by a stored mode.