This commit is contained in:
2026-07-09 21:33:33 +02:00
commit 84a2a365f3
2364 changed files with 950134 additions and 0 deletions
@@ -0,0 +1,33 @@
using System;
using Sirenix.OdinInspector;
using VOID.Generic.Dict;
namespace VOID.Generic.Objects.Unit.Data
{
[Serializable]
public record UnitResources
{
[MinValue(0f)] public float actionPoints = 2f;
[MinValue(0f)] public float movePoints = 0f;
public float Get(UnitResourceType type)
{
return type switch
{
UnitResourceType.ActionPoints => actionPoints,
UnitResourceType.MovePoints => movePoints,
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null)
};
}
public void Set(UnitResourceType type, float value)
{
switch(type)
{
case UnitResourceType.ActionPoints: actionPoints = value; return;
case UnitResourceType.MovePoints: movePoints = value; return;
default: throw new ArgumentOutOfRangeException(nameof(type), type, null);
};
}
}
}