Exemplo n.º 1
0
 public SkillScore(Character character, Skill skill, uint ranks = 0, IEnumerable<string> foci = null)
     : base(ranks, null)
 {
     Skill = skill;
     AttributeScore = character.GetAttributeScore(skill.PrimaryAttribute);
     Foci = new HashSet<string>(foci ?? new string[] { });
 }
Exemplo n.º 2
0
        public void TestGetAttributeScore()
        {
            var masterValuesTable = new List<MasterValueRecord>();
            masterValuesTable.Add(new MasterValueRecord() { Score = 1, PassiveModifier = 2 });
            masterValuesTable.Add(new MasterValueRecord() { Score = 2, PassiveModifier = 4 });
            masterValuesTable.Add(new MasterValueRecord() { Score = 3, PassiveModifier = 6 });

            var character = new Character(masterValuesTable);

            var cases = new Dictionary<Attributes, Func<Character, AttributeScore>>()
            {
                { Attributes.Might, c => c.Might },
                { Attributes.Prowess, c => c.Prowess },
                { Attributes.Quickness, c => c.Quickness },
                { Attributes.Vigor, c => c.Vigor },
                { Attributes.Charisma, c => c.Charisma },
                { Attributes.Insight, c => c.Insight },
                { Attributes.Logic, c => c.Logic },
                { Attributes.Resolve, c => c.Resolve },
            };

            foreach (var kvp in cases)
            {
                Assert.That(kvp.Value(character), Is.EqualTo(character.GetAttributeScore(kvp.Key)));
            }
        }