public void CombineSingleBuffAndStat() { var stat1 = new Stat(50, StatType.HitChance); var hitChanceBoost = new DummyBuff(new Dictionary <StatType, Func <int, int> > { { StatType.HitChance, (i) => i + 10 } }); var result = StatUtils.ComputeStats(new List <Stat> { stat1 }, new List <IBuff> { hitChanceBoost }).ToList(); Assert.AreEqual(1, result.Count); var modded = result[0]; Assert.AreEqual(60, modded.Value); Assert.AreEqual(StatType.HitChance, modded.Type); }
public void IgnoreNonBuffedStats() { var stat1 = new Stat(50, StatType.HitChance); var crit = new Stat(10, StatType.CritChance); var hitChanceBoost = new DummyBuff(new Dictionary <StatType, Func <int, int> > { { StatType.HitChance, (i) => i + 10 } }); var result = StatUtils.ComputeStats(new List <Stat> { stat1, crit }, new List <IBuff> { hitChanceBoost }).ToList(); Assert.AreEqual(2, result.Count); var moddedHit = result.Find(stat => stat.Type == StatType.HitChance); var moddedCrit = result.Find(stat => stat.Type == StatType.CritChance); Assert.AreEqual(60, moddedHit.Value); Assert.AreEqual(10, moddedCrit.Value); }