Exemple #1
0
    protected T CreateStat <T>(Base_Stat_Type stat_Type) where T : Base_Stat
    {
        T stat = System.Activator.CreateInstance <T>();

        StatDict.Add(stat_Type, stat);
        return(stat);
    }
Exemple #2
0
 public Base_Stat GetStat(Base_Stat_Type stat_Type)
 {
     if (ContainStat(stat_Type))
     {
         return(StatDict[stat_Type]);
     }
     return(null);
 }
Exemple #3
0
    protected T CreateOrGetStat <T>(Base_Stat_Type stat_Type) where T : Base_Stat
    {
        T stat = GetStat <T>(stat_Type);

        if (stat == null)
        {
            stat = CreateStat <T>(stat_Type);
        }
        return(stat);
    }
Exemple #4
0
 public T GetStat <T>(Base_Stat_Type type) where T : Base_Stat
 {
     return(GetStat(type) as T);
 }
Exemple #5
0
 public bool ContainStat(Base_Stat_Type stat_Type)
 {
     return(StatDict.ContainsKey(stat_Type));
 }