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,45 @@
using System;
using Sirenix.OdinInspector;
using VOID.Generic.Dict;
namespace VOID.Generic.Objects.Unit.Data
{
[Serializable]
public record MainAttributes
{
[MinValue(1f)] public int strength = 5;
[MinValue(1f)] public int dexterity = 5;
[MinValue(1f)] public int intelligence = 5;
[MinValue(1f)] public int constitution = 5;
[MinValue(1f)] public int speed = 5;
[MinValue(1f)] public int perception = 5;
public int Get(MainAttributeType type)
{
return type switch
{
MainAttributeType.Strength => strength,
MainAttributeType.Dexterity => dexterity,
MainAttributeType.Intelligence => intelligence,
MainAttributeType.Constitution => constitution,
MainAttributeType.Speed => speed,
MainAttributeType.Perception => perception,
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null)
};
}
public void Set(MainAttributeType type, int value)
{
switch(type)
{
case MainAttributeType.Strength: strength = value; return;
case MainAttributeType.Dexterity: dexterity = value; return;
case MainAttributeType.Intelligence: intelligence = value; return;
case MainAttributeType.Constitution: constitution = value; return;
case MainAttributeType.Speed: speed = value; return;
case MainAttributeType.Perception: perception = value; return;
default: throw new ArgumentOutOfRangeException(nameof(type), type, null);
};
}
}
}