Пример #1
0
 public Stat(StatInternal statInternal)
 {
     type    = statInternal.Type;
     display = statInternal.Display;
     // here to do rounding logic, right now rounding down is happening
     value = (int)statInternal.Value;
 }
Пример #2
0
 public StatInstance(StatInstance obj)
 {
     stats.Clear();
     foreach (StatType type in obj.stats.Keys)
     {
         StatInternal stat = obj.stats[type];
         stats.Add(type, new StatInternal(stat.Type, stat.Value));
     }
 }
Пример #3
0
 public void ApplyMod(StatModifier mod)
 {
     if (stats.ContainsKey(mod.StatType))
     {
         StatInternal newStat = new StatInternal(stats[mod.StatType].Type, mod.Apply(stats[mod.StatType].Value, mod.StatType));
         if (newStat.Value < 0)
         {
             newStat = new StatInternal(mod.StatType, 0f);
         }
         stats.Remove(mod.StatType);
         stats.Add(mod.StatType, newStat);
     }
     else
     {
         Console.WriteLine("doesnt have stat of type " + mod.StatType);
     }
 }