Server.Items.Spellbook.FindSpellbookInList C# (CSharp) Méthode

FindSpellbookInList() public static méthode

public static FindSpellbookInList ( List list, Mobile from, int spellID, SpellbookType type ) : Spellbook
list List
from Mobile
spellID int
type SpellbookType
Résultat Spellbook
        public static Spellbook FindSpellbookInList( List<Spellbook> list, Mobile from, int spellID, SpellbookType type )
        {
            Container pack = from.Backpack;

            for ( int i = list.Count - 1; i >= 0; --i )
            {
                if ( i >= list.Count )
                    continue;

                Spellbook book = list[i];

                if ( !book.Deleted && (book.Parent == from || (pack != null && book.Parent == pack)) && ValidateSpellbook( book, spellID, type ) )
                    return book;

                list.RemoveAt( i );
            }

            return null;
        }