private IEnumerable <Skill> ApplyBonuses(string creature, CreatureType creatureType, IEnumerable <Skill> skills, string size) { var creatureBonuses = skillSelector.SelectBonusesFor(creature); var typeBonuses = skillSelector.SelectBonusesFor(creatureType.Name); var bonuses = creatureBonuses.Union(typeBonuses); foreach (var subtype in creatureType.SubTypes) { var subtypeBonuses = skillSelector.SelectBonusesFor(subtype); bonuses = bonuses.Union(subtypeBonuses); } foreach (var bonus in bonuses) { var matchingSkills = skills.Where(s => s.IsEqualTo(bonus.Target)); foreach (var skill in matchingSkills) { skill.AddBonus(bonus.Bonus, bonus.Condition); } } skills = ApplyHideSkillSizeModifier(skills, size); return(skills); }
public void SelectNoSkillBonus() { var bonusSelections = skillSelector.SelectBonusesFor("creature"); Assert.That(bonusSelections, Is.Empty); }