Server.Poison.Register C# (CSharp) Méthode

Register() public static méthode

public static Register ( Poison reg ) : void
reg Poison
Résultat void
        public static void Register( Poison reg )
        {
            string regName = reg.Name.ToLower();

            for ( int i = 0; i < m_Poisons.Count; i++ )
            {
                if ( reg.Level == m_Poisons[i].Level )
                    throw new Exception( "A poison with that level already exists." );
                else if ( regName == m_Poisons[i].Name.ToLower() )
                    throw new Exception( "A poison with that name already exists." );
            }

            m_Poisons.Add( reg );
        }