neon-sprawl/server/NeonSprawl.Server/Game/Combat/ICombatEntityHealthStore.cs

31 lines
1.4 KiB
C#

namespace NeonSprawl.Server.Game.Combat;
/// <summary>
/// Server-owned HP store for prototype combat dummies keyed by
/// <see cref="Targeting.PrototypeTargetRegistry"/> target id (NEO-80).
/// </summary>
/// <remarks>
/// <para><b>NEO-81+:</b> combat resolution should depend on this interface rather than reaching into store internals.</para>
/// <para>Re-hit deny on defeated targets belongs in <c>CombatOperations</c> (NEO-81), not this store.</para>
/// </remarks>
public interface ICombatEntityHealthStore
{
/// <summary>
/// Reads the current snapshot for a known prototype target. Lazy-initializes HP to
/// <see cref="PrototypeCombatConstants.MaxPrototypeTargetHp"/> on first access.
/// </summary>
bool TryGet(string? targetId, out CombatEntityHealthSnapshot snapshot);
/// <summary>
/// Applies non-negative damage to a known prototype target. Lazy-initializes on first access.
/// Floors <see cref="CombatEntityHealthSnapshot.CurrentHp"/> at zero.
/// </summary>
bool TryApplyDamage(string? targetId, int damage, out CombatEntityHealthSnapshot snapshot);
/// <summary>
/// Restores a known prototype target to full HP and clears <see cref="CombatEntityHealthSnapshot.Defeated"/>.
/// Creates the row when absent. Intended for tests and future dev fixtures — not HTTP in Slice 1.
/// </summary>
bool TryResetToFull(string? targetId, out CombatEntityHealthSnapshot snapshot);
}