Exemple #1
0
    public T GetValue <T>(CardPlayerStatType type)
    {
        object obj = GetValue(type);

        if (obj != null)
        {
            return((T)obj);
        }
        return(default);
Exemple #2
0
    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
        }
    }
Exemple #3
0
 public bool HasValue(CardPlayerStatType type) => Stats != null && Stats.ContainsKey(type);