コード例 #1
0
 public bool HasSameItems(ItemConfiguration configuration)
 {
     if (Items.Count != configuration.Items.Count)
         return false;
     for (int i = 0; i < Items.Count; i++)
     {
         if (!object.ReferenceEquals(Items[i], configuration.Items[i]))
             return false;
     }
     return true;
 }
コード例 #2
0
ファイル: Simulation.cs プロジェクト: epicvrvs/LoLSimulation
        ItemConfiguration GetItemConfiguration(int level, List<Item> currentConfiguration)
        {
            ItemConfiguration configuration = new ItemConfiguration(currentConfiguration);

            int baseHealth = 445 + 87 * level;
            double baseArmour = 16.2 + 3.7 * level;
            double baseMagicResistance = 30 + 1.25 * level;

            int runeHealth = 0;
            double runeArmour = 9 * 1.41;
            double runeMagicResistance = 9 * 0.15 * level;

            int masteryHealth = 6 * level + 30;
            int masteryArmour = 2 + 2 + 1;
            int masteryMagicResistance = 2 + 2 + 1;

            int health = baseHealth + runeHealth + masteryHealth + configuration.Health;
            double armour = baseArmour + runeArmour + masteryArmour + configuration.Armour;
            double magicResistance = baseMagicResistance + runeMagicResistance + masteryMagicResistance + configuration.MagicResistance;

            double runeFlatArmourPenetration = 9 * 1.28;
            double runeFlatMagicPenetration = 9 * 0.87;

            int masteryFlatArmourPenetration = 2 + 2 + 1;
            double masteryPercentageArmourPenetration = 0.08;
            int masteryFlatMagicPenetration = 0;
            double masteryPercentageMagicPenetration = 0.08;

            double lastWhisperPercentageArmourPenetration = 0.35;
            double voidStaffPercentageMagicPenetration = 0.35;

            double flatArmourPenetration = runeFlatArmourPenetration + masteryFlatArmourPenetration;
            List<double> armourPercentagePenetrations = new List<double>();
            armourPercentagePenetrations.Add(masteryPercentageArmourPenetration);
            if (level >= 15)
                armourPercentagePenetrations.Add(lastWhisperPercentageArmourPenetration);

            double flatMagicPenetration = runeFlatMagicPenetration + masteryFlatMagicPenetration;
            List<double> magicPercentagePenetration = new List<double>();
            magicPercentagePenetration.Add(masteryPercentageMagicPenetration);
            if (level >= 15)
                magicPercentagePenetration.Add(voidStaffPercentageMagicPenetration);

            configuration.EffectiveHealthAgainstPhysicalDamage = GetEffectiveHealth(health, armour, flatArmourPenetration, armourPercentagePenetrations);
            configuration.EffectiveHealthAgainstMagicDamage = GetEffectiveHealth(health, magicResistance, flatMagicPenetration, magicPercentagePenetration);

            return configuration;
        }