public double this[UnitStatType index] { get { return(dat[(int)index]); } set { dat[(int)index] = value; } }
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); }
public int GetStatValue(UnitStatType statType) { var statValue = Stats[statType]; var modifications = StatModifier.GetModifications(statType); foreach (var modification in modifications) { statValue += modification.Value; } return(statValue); }
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); } } }
public void AddModification(UnitStatType statType, StatModification modification) { if (Modifications.ContainsKey(statType)) { Modifications[statType].Add(modification); } else { Modifications.Add(statType, new List <StatModification>() { modification }); } }
public int GetStatValue(UnitStatType statType) { return(Stats[statType]); }
public List <StatModification> GetModifications(UnitStatType statType) { return(Modifications[statType]); }