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

        SocialStatDic.Add(statType, stat);
        return(stat);
    }
Example #4
0
 public SocialStat GetStat(SocialStatType statType)
 {
     if (ContainStat(statType))
     {
         return(SocialStatDic[statType]);
     }
     return(null);
 }
Example #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);
    }
Example #6
0
 public bool ContainStat(SocialStatType statType)
 {
     return(SocialStatDic.ContainsKey(statType));
 }
Example #7
0
 public T GetStat <T>(SocialStatType type) where T : SocialStat
 {
     return(GetStat(type) as T);
 }