Пример #1
0
        public Character(WorldDate currentWorldDate, string firstname, string dynasty, CharacterGender characterGender)
        {
            Firstname = firstname;
            Dynasty = dynasty;
            BornDate = new WorldDate(currentWorldDate.Year, currentWorldDate.Season, currentWorldDate.Day);
            var gender = characterGender;
            _rawAttributes = new Dictionary<string, ICharacterAttribute>();
            _modifiedAttributes = new Dictionary<string, ICharacterAttribute>();
            Traits = new List<Trait>();
            AddAttribute(new ValueCharacterAttribute("Fertility", 0.5m));
            AddAttribute(new ValueCharacterAttribute("Combat", 1m));
            AddAttribute(new ValueCharacterAttribute("Strength", 10));

            var mods = new List<Modifier>()
            {
                new Modifier("Fertility",0.5m, new FlatModifier())
            };

            var kuk = new Trait("Järnringsvigör", mods);

            if (Dynasty == "Järnring")
            {
                AddTrait(kuk);
            }

            mods = new List<Modifier>()
            {
                new Modifier("Combat", 8m,new FlatModifier()),
                new Modifier("Strength", 4m,new FlatModifier())
            };

            kuk = new Trait("Dunhallskrigare", mods);
            if (Dynasty == "Dunhall")
            {
                AddTrait(kuk);
            }

            _modifiedAttributes = FetchModifiedAttributes();

            foreach (var modifiedAttribute in _modifiedAttributes)
            {
                Console.WriteLine(firstname + " " + dynasty + " " + modifiedAttribute.Key + ": " + modifiedAttribute.Value.Value);
            }

            Console.WriteLine(Traits.Count);
        }
Пример #2
0
 public void AddTrait(Trait t)
 {
     Traits.Add(t);
     AreModifiedAttributesCurrent = false;
 }
Пример #3
0
 public void AddTrait(Trait t)
 {
     Traits.Add(t);
     AreModifiedAttributesCurrent = false;
 }