namespace Content.Server.Arcade.SpaceVillain;
public sealed partial class SpaceVillainGame
{
///
/// A state holder for the fighters in the SpaceVillain game.
///
public sealed class Fighter
{
///
/// The current hit point total of the fighter.
///
[ViewVariables(VVAccess.ReadWrite)]
public int Hp
{
get => _hp;
set => _hp = MathHelper.Clamp(value, 0, HpMax);
}
private int _hp;
///
/// The maximum hit point total of the fighter.
///
[ViewVariables(VVAccess.ReadWrite)]
public int HpMax
{
get => _hpMax;
set
{
_hpMax = Math.Max(value, 0);
Hp = MathHelper.Clamp(Hp, 0, HpMax);
}
}
private int _hpMax;
///
/// The current mana total of the fighter.
///
[ViewVariables(VVAccess.ReadWrite)]
public int Mp
{
get => _mp;
set => _mp = MathHelper.Clamp(value, 0, MpMax);
}
private int _mp;
///
/// The maximum mana total of the fighter.
///
[ViewVariables(VVAccess.ReadWrite)]
public int MpMax
{
get => _mpMax;
set
{
_mpMax = Math.Max(value, 0);
Mp = MathHelper.Clamp(Mp, 0, MpMax);
}
}
private int _mpMax;
///
/// Whether the given fighter can take damage/lose mana.
///
[ViewVariables(VVAccess.ReadWrite)]
public bool Invincible = false;
}
}