Пример #1
0
        //
        public static IReadOnlyList <InstantCastEvent> ComputeInstantCastEvents(IReadOnlyList <Player> players, CombatData combatData, SkillData skillData, AgentData agentData, FightLogic logic)
        {
            var instantCastFinders = new HashSet <InstantCastFinder>(_genericInstantCastFinders);

            logic.GetInstantCastFinders().ForEach(x => instantCastFinders.Add(x));
            var res = new List <InstantCastEvent>();

            foreach (Player p in players)
            {
                switch (p.Spec)
                {
                //
                case Spec.Elementalist:
                    ElementalistHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Tempest:
                    ElementalistHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    TempestHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Weaver:
                    ElementalistHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    WeaverHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Catalyst:
                    ElementalistHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    CatalystHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                //
                case Spec.Necromancer:
                    NecromancerHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Reaper:
                    NecromancerHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    ReaperHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Scourge:
                    NecromancerHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    ScourgeHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Harbinger:
                    NecromancerHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    HarbingerHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                //
                case Spec.Mesmer:
                    MesmerHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Chronomancer:
                    MesmerHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    ChronomancerHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Mirage:
                    MesmerHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    MirageHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Virtuoso:
                    MesmerHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    VirtuosoHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                //
                case Spec.Thief:
                    ThiefHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Daredevil:
                    ThiefHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    DaredevilHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Deadeye:
                    ThiefHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    DeadeyeHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Specter:
                    ThiefHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    SpecterHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                //
                case Spec.Engineer:
                    EngineerHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Scrapper:
                    EngineerHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    ScrapperHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Holosmith:
                    EngineerHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    HolosmithHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Mechanist:
                    EngineerHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    MechanistHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                //
                case Spec.Ranger:
                    RangerHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Druid:
                    RangerHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    DruidHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Soulbeast:
                    RangerHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    SoulbeastHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Untamed:
                    RangerHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    UntamedHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                //
                case Spec.Revenant:
                    RevenantHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Herald:
                    RevenantHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    HeraldHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Renegade:
                    RevenantHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    RenegadeHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Vindicator:
                    RevenantHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    VindicatorHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                //
                case Spec.Guardian:
                    GuardianHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Dragonhunter:
                    GuardianHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    DragonhunterHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Firebrand:
                    GuardianHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    FirebrandHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Willbender:
                    GuardianHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    WillbenderHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                //
                case Spec.Warrior:
                    WarriorHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Berserker:
                    WarriorHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    BerserkerHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Spellbreaker:
                    WarriorHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    SpellbreakerHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;

                case Spec.Bladesworn:
                    WarriorHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    BladeswornHelper.InstantCastFinder.ForEach(x => instantCastFinders.Add(x));
                    break;
                }
            }
            res.AddRange(ComputeInstantCastEvents(combatData, skillData, agentData, instantCastFinders.ToList()));
            return(res);
        }