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,31 @@
using System;
using Sirenix.OdinInspector;
using VOID.Generic.Dict;
namespace VOID.Generic.Objects.Abstract.Data
{
[Serializable]
public record Resources
{
[MinValue(0f)]
public float health = 10f;
public float Get(BasicResourceType type)
{
return type switch
{
BasicResourceType.Health => health,
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null)
};
}
public void Set(BasicResourceType type, float value)
{
switch(type)
{
case BasicResourceType.Health: health = value; return;
default: throw new ArgumentOutOfRangeException(nameof(type), type, null);
};
}
}
}