public T GetValue <T>(CardPlayerStatType type) { object obj = GetValue(type); if (obj != null) { return((T)obj); } return(default);
public void Register(CardPlayerStatType type, OnStatTypeChanged del, bool directUpdate = false) { if (!registeredEvents.ContainsKey(type)) { registeredEvents[type] = del; } else { registeredEvents[type] += del; } if (directUpdate && HasValue(type)) { del(GetValue(type)); //Update directly after registration } }
public bool HasValue(CardPlayerStatType type) => Stats != null && Stats.ContainsKey(type);