Server.Commands.CommandHandlers.ClearFacet_OnCommand C# (CSharp) Méthode

ClearFacet_OnCommand() private méthode

private ClearFacet_OnCommand ( Server.Commands.CommandEventArgs e ) : void
e Server.Commands.CommandEventArgs
Résultat void
		public static void ClearFacet_OnCommand( CommandEventArgs e )
		{
			Map map = e.Mobile.Map;

			if ( map == null || map == Map.Internal )
			{
				e.Mobile.SendMessage( "You may not run that command here." );
				return;
			}

			List<IEntity> list = new List<IEntity>();

			foreach ( Item item in World.Items.Values )
				if ( item.Map == map && item.Parent == null )
					list.Add( item );

			foreach ( Mobile m in World.Mobiles.Values )
				if ( m.Map == map && !m.Player )
					list.Add( m );

			if ( list.Count > 0 )
			{
				CommandLogging.WriteLine( e.Mobile, "{0} {1} starting facet clear of {2} ({3} object{4})", e.Mobile.AccessLevel, CommandLogging.Format( e.Mobile ), map, list.Count, list.Count == 1 ? "" : "s" );

				e.Mobile.SendGump(
					new WarningGump( 1060635, 30720,
					String.Format( "You are about to delete {0} object{1} from this facet.  Do you really wish to continue?",
					list.Count, list.Count == 1 ? "" : "s" ),
					0xFFC000, 360, 260, new WarningGumpCallback( DeleteList_Callback ), list ) );
			}
			else
			{
				e.Mobile.SendMessage( "There were no objects found to delete." );
			}
		}