//returns -1 if not set public double this[statsType index] { set { foreach (stat s in stats) if (s.Type == index) s.Amount = value; } get { foreach (stat s in stats) if (s.Type == index) return s.Amount; return -1; } }
public static bool IsBaseStateType(statsType s) { return (int)s <5; }