Example #1
0
 public double this[UnitStatType index]
 {
     get
     {
         return(dat[(int)index]);
     }
     set
     {
         dat[(int)index] = value;
     }
 }
Example #2
0
        public int GetStatValue(int level, UnitStatType statType)
        {
            var statValue = Stats[statType];

            if (LevelConfig.ContainsKey(level))
            {
                var levelConfig = LevelConfig[level];

                statValue = (int)(statValue * levelConfig[statType]);
            }

            return(statValue);
        }
Example #3
0
        public int GetStatValue(UnitStatType statType)
        {
            var statValue = Stats[statType];

            var modifications = StatModifier.GetModifications(statType);

            foreach (var modification in modifications)
            {
                statValue += modification.Value;
            }

            return(statValue);
        }
Example #4
0
        public void RemoveModification(UnitStatType statType, string key)
        {
            if (Modifications.ContainsKey(statType))
            {
                var modifications = Modifications[statType];

                var modification = modifications.FirstOrDefault(m => m.Key.Equals(key));

                if (modification != null)
                {
                    modifications.Remove(modification);
                }
            }
        }
Example #5
0
 public void AddModification(UnitStatType statType, StatModification modification)
 {
     if (Modifications.ContainsKey(statType))
     {
         Modifications[statType].Add(modification);
     }
     else
     {
         Modifications.Add(statType, new List <StatModification>()
         {
             modification
         });
     }
 }
Example #6
0
 public int GetStatValue(UnitStatType statType)
 {
     return(Stats[statType]);
 }
Example #7
0
 public List <StatModification> GetModifications(UnitStatType statType)
 {
     return(Modifications[statType]);
 }