Exemplo n.º 1
0
        public GearSet(Gear headgear, Gear clothing, Gear shoes)
        {
            if( headgear.GearType != GearType.Headgear ) 
                throw new Exception("Headgear provided that is not headgear: " + headgear.Name);
            if( clothing.GearType != GearType.Clothing )
                throw new Exception("Clothing provided that is not clothing: " + clothing.Name);
            if (shoes.GearType != GearType.Shoes)
                throw new Exception("Shoes provided that are not shoes: " + shoes.Name);

            HeadGear = headgear;
            Clothing = clothing;
            Shoes = shoes;
        }
Exemplo n.º 2
0
        private void AddGearAbilities(Dictionary<Ability, int> abilities, Gear gear)
        {
            foreach (var ability in gear.AbilityValues.Keys)
            {
                if (abilities.ContainsKey(ability))
                {
                    abilities[ability] += gear.AbilityValues[ability];
                }
                else
                {
                    abilities[ability] = gear.AbilityValues[ability];
                }

            }
        }