Auto_Disable.Program.CheckForSecondSpell C# (CSharp) Method

CheckForSecondSpell() private static method

private static CheckForSecondSpell ( Unit t ) : Ability
t Unit
return Ability
        private static Ability CheckForSecondSpell(Unit t)
        {
            try
            {
                for (var n = 0; n < CounterSpells.Length; n++)
                    if (t.ClassID == CounterSpells[n].Hero)
                    {
                        //PrintInfo("Hero catched: " + CounterSpells[n]._intKey);
                        switch (CounterSpells[n].IntKey)
                        {
                            case 1:
                                return t.Spellbook.Spell1;
                            case 2:
                                return t.Spellbook.Spell2;
                            case 3:
                                return t.Spellbook.Spell3;
                            case 4:
                                return t.Spellbook.Spell4;
                            case 5:
                                return t.Spellbook.Spell5;
                        }
                        break;
                    }
            }
            catch (Exception)
            {
                //PrintError(e.ToString());
            }
            //PrintInfo("Return: 0" );
            return null;
        }