コード例 #1
0
ファイル: GearSet.cs プロジェクト: AdamHong/SplatoonTools
        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;
        }
コード例 #2
0
ファイル: GearSet.cs プロジェクト: AdamHong/SplatoonTools
        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];
                }

            }
        }