26 lines
996 B
C#
26 lines
996 B
C#
namespace NeonSprawl.Server.Game.Combat;
|
|
|
|
/// <summary>
|
|
/// Session in-memory player combat HP for incoming NPC damage (NEO-95).
|
|
/// No Postgres persistence in Epic 5 Slice 2.
|
|
/// </summary>
|
|
public interface IPlayerCombatHealthStore
|
|
{
|
|
/// <summary>
|
|
/// Reads the current snapshot for a player. Lazy-initializes HP to
|
|
/// <see cref="PlayerCombatHealthDefaults.MaxHp"/> on first access.
|
|
/// </summary>
|
|
bool TryGet(string? playerId, out PlayerCombatHealthSnapshot snapshot);
|
|
|
|
/// <summary>
|
|
/// Applies non-negative NPC attack damage. Lazy-initializes on first access.
|
|
/// Floors <see cref="PlayerCombatHealthSnapshot.CurrentHp"/> at zero.
|
|
/// </summary>
|
|
bool TryApplyDamage(string? playerId, int damage, out PlayerCombatHealthSnapshot snapshot);
|
|
|
|
/// <summary>
|
|
/// Restores a player to full HP. Creates the row when absent (dev fixture + tests).
|
|
/// </summary>
|
|
bool TryResetToFull(string? playerId, out PlayerCombatHealthSnapshot snapshot);
|
|
}
|