Server.Items.Corpse.GetCorpseName C# (CSharp) Méthode

GetCorpseName() public static méthode

public static GetCorpseName ( Server.Mobile m ) : string
m Server.Mobile
Résultat string
		public static string GetCorpseName( Mobile m )
		{
			if ( m is BaseCreature )
			{
				BaseCreature bc = (BaseCreature)m;

				if ( bc.CorpseNameOverride != null )
					return bc.CorpseNameOverride;
			}

			Type t = m.GetType();

			object[] attrs = t.GetCustomAttributes( typeof( CorpseNameAttribute ), true );

			if ( attrs != null && attrs.Length > 0 )
			{
				CorpseNameAttribute attr = attrs[0] as CorpseNameAttribute;

				if ( attr != null )
					return attr.Name;
			}

			return null;
		}