Esempio n. 1
0
 public SocialStat(string name, int value, int max, SocialStatType link)
 {
     this.StatName      = name;
     this.StatBaseValue = value;
     this.StatMaxValue  = max;
     this.Link          = link;
 }
Esempio n. 2
0
 public SocialStat()
 {
     this.StatName      = string.Empty;
     this.StatBaseValue = 0;
     this.StatMaxValue  = 3;
     this.Link          = SocialStatType.None;
 }
Esempio n. 3
0
    protected T CreateStat <T>(SocialStatType statType) where T : SocialStat
    {
        T stat = System.Activator.CreateInstance <T>();

        SocialStatDic.Add(statType, stat);
        return(stat);
    }
Esempio n. 4
0
 public SocialStat GetStat(SocialStatType statType)
 {
     if (ContainStat(statType))
     {
         return(SocialStatDic[statType]);
     }
     return(null);
 }
Esempio n. 5
0
    protected T CreateOrGetStat <T>(SocialStatType statType) where T : SocialStat
    {
        T stat = GetStat <T>(statType);

        if (stat == null)
        {
            stat = CreateStat <T>(statType);
        }
        return(stat);
    }
Esempio n. 6
0
 public bool ContainStat(SocialStatType statType)
 {
     return(SocialStatDic.ContainsKey(statType));
 }
Esempio n. 7
0
 public T GetStat <T>(SocialStatType type) where T : SocialStat
 {
     return(GetStat(type) as T);
 }