Example #1
0
        public static void DoWipe(Mobile from, Map map, Point3D start, Point3D end, WipeType type)
        {
            CommandLogging.WriteLine(from, "{0} {1} wiping from {2} to {3} in {5} ({4})", from.AccessLevel, CommandLogging.Format(from), start, end, type, map);

            bool mobiles = ((type & WipeType.Mobiles) != 0);
            bool multis  = ((type & WipeType.Multis) != 0);
            bool items   = ((type & WipeType.Items) != 0);

            ArrayList toDelete = new ArrayList();

            Rectangle2D rect = new Rectangle2D(start.X, start.Y, end.X - start.X + 1, end.Y - start.Y + 1);

            IEnumerable <object> eable;

            if ((items || multis) && mobiles)
            {
                eable = map.GetObjectsInBounds(rect);
            }
            else if (items || multis)
            {
                eable = map.GetItemsInBounds(rect);
            }
            else if (mobiles)
            {
                eable = map.GetMobilesInBounds(rect);
            }
            else
            {
                return;
            }

            foreach (object obj in eable)
            {
                if (items && (obj is Item) && !((obj is BaseMulti) || (obj is HouseSign)))
                {
                    toDelete.Add(obj);
                }
                else if (multis && (obj is BaseMulti))
                {
                    toDelete.Add(obj);
                }
                else if (mobiles && (obj is Mobile) && !((Mobile)obj).IsPlayer)
                {
                    toDelete.Add(obj);
                }
            }


            for (int i = 0; i < toDelete.Count; ++i)
            {
                if (toDelete[i] is Item)
                {
                    ((Item)toDelete[i]).Delete();
                }
                else if (toDelete[i] is Mobile)
                {
                    ((Mobile)toDelete[i]).Delete();
                }
            }
        }
Example #2
0
        public static void DoWipe( Mobile from, Map map, Point3D start, Point3D end, WipeType type )
        {
            CommandLogging.WriteLine( from, "{0} {1} wiping from {2} to {3} in {5} ({4})", from.AccessLevel, CommandLogging.Format( from ), start, end, type, map );

            bool mobiles = ( ( type & WipeType.Mobiles ) != 0 );
            bool multis = ( ( type & WipeType.Multis ) != 0 );
            bool items = ( ( type & WipeType.Items ) != 0 );

            ArrayList toDelete = new ArrayList();

            Rectangle2D rect = new Rectangle2D( start.X, start.Y, end.X - start.X + 1, end.Y - start.Y + 1 );

            IEnumerable<object> eable;

            if ( ( items || multis ) && mobiles )
            {
                eable = map.GetObjectsInBounds( rect );
            }
            else if ( items || multis )
            {
                eable = map.GetItemsInBounds( rect );
            }
            else if ( mobiles )
            {
                eable = map.GetMobilesInBounds( rect );
            }
            else
            {
                return;
            }

            foreach ( object obj in eable )
            {
                if ( items && ( obj is Item ) && !( ( obj is BaseMulti ) || ( obj is HouseSign ) ) )
                {
                    toDelete.Add( obj );
                }
                else if ( multis && ( obj is BaseMulti ) )
                {
                    toDelete.Add( obj );
                }
                else if ( mobiles && ( obj is Mobile ) && !( (Mobile) obj ).IsPlayer )
                {
                    toDelete.Add( obj );
                }
            }

            for ( int i = 0; i < toDelete.Count; ++i )
            {
                if ( toDelete[i] is Item )
                {
                    ( (Item) toDelete[i] ).Delete();
                }
                else if ( toDelete[i] is Mobile )
                {
                    ( (Mobile) toDelete[i] ).Delete();
                }
            }
        }
Example #3
0
        public static void DoWipe(Mobile from, Map map, Point3D start, Point3D end, WipeType type)
        {
            CommandLogging.WriteLine(from, "{0} {1} wiping from {2} to {3} in {5} ({4})", from.AccessLevel, CommandLogging.Format(from), start, end, type, map);

            bool mobiles = (type & WipeType.Mobiles) != 0;
            bool multis  = (type & WipeType.Multis) != 0;
            bool items   = (type & WipeType.Items) != 0;

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

            Rectangle2D rect = new Rectangle2D(start.X, start.Y, end.X - start.X + 1, end.Y - start.Y + 1);

            IPooledEnumerable eable;

            if ((items || multis) && mobiles)
            {
                eable = map.GetObjectsInBounds(rect);
            }
            else if (items || multis)
            {
                eable = map.GetItemsInBounds(rect);
            }
            else if (mobiles)
            {
                eable = map.GetMobilesInBounds(rect);
            }
            else
            {
                return;
            }

            foreach (IEntity obj in eable)
            {
                if (items && obj is Item && !(obj is BaseMulti || obj is HouseSign))
                {
                    toDelete.Add(obj);
                }
                else if (multis && obj is BaseMulti)
                {
                    toDelete.Add(obj);
                }
                else if (mobiles && obj is Mobile && !((Mobile)obj).Player)
                {
                    toDelete.Add(obj);
                }
            }

            eable.Free();

            for (int i = 0; i < toDelete.Count; ++i)
            {
                toDelete[i].Delete();
            }
        }
Example #4
0
		public static void DoWipe( Mobile from, Map map, Point3D start, Point3D end, WipeType type )
		{
			CommandLogging.WriteLine( from, "{0} {1} wiping from {2} to {3} in {5} ({4})", from.AccessLevel, CommandLogging.Format( from ), start, end, type, map );

			bool mobiles = ( (type & WipeType.Mobiles) != 0 );
			bool multis = ( (type & WipeType.Multis) != 0 );
			bool items = ( (type & WipeType.Items) != 0 );

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

			Rectangle2D rect = new Rectangle2D( start.X, start.Y, end.X - start.X + 1, end.Y - start.Y + 1 );

			IPooledEnumerable eable;

			if ( (items || multis) && mobiles )
				eable = map.GetObjectsInBounds( rect );
			else if ( items || multis )
				eable = map.GetItemsInBounds( rect );
			else if ( mobiles )
				eable = map.GetMobilesInBounds( rect );
			else
				return;

			foreach ( IEntity obj in eable )
			{
				if ( items && (obj is Item) && ((Item)obj).CommandDelete && !((obj is BaseMulti) || (obj is HouseSign)) )
					toDelete.Add( obj );
				else if ( multis && (obj is BaseMulti) )
					toDelete.Add( obj );
				else if ( mobiles && (obj is Mobile) && !((Mobile)obj).Player )
					toDelete.Add( obj );
			}

			eable.Free();

			foreach (IEntity d in toDelete)
				d.Delete();
		}
Example #5
0
        public static void DoWipe(Mobile from, Map map, Point3D start, Point3D end, WipeType type)
        {
            CommandLogging.WriteLine(
                from,
                "{0} {1} wiping from {2} to {3} in {5} ({4})",
                from.AccessLevel,
                CommandLogging.Format(from),
                start,
                end,
                type,
                map
                );

            var mobiles = (type & WipeType.Mobiles) != 0;
            var multis  = (type & WipeType.Multis) != 0;
            var items   = (type & WipeType.Items) != 0;

            var toDelete = new List <IEntity>();

            var rect = new Rectangle2D(start.X, start.Y, end.X - start.X + 1, end.Y - start.Y + 1);

            IPooledEnumerable <IEntity> eable;

            if (!items && !multis || !mobiles)
            {
                return;
            }

            eable = map.GetObjectsInBounds(rect);

            foreach (var obj in eable)
            {
                if (items && obj is Item && !(obj is BaseMulti or HouseSign))
                {
                    toDelete.Add(obj);
                }
Example #6
0
 public static void BeginWipe(Mobile from, WipeType type)
 {
     BoundingBoxPicker.Begin(from, new BoundingBoxCallback(WipeBox_Callback), type);
 }
Example #7
0
 /// <summary>
 /// Creates and initializes a new instance of the WipeEffect class.
 /// </summary>
 /// <param name="type">Wipe type. Hide or show.</param>
 /// <param name="direction">Wipe direction.</param>
 /// <since_tizen> preview </since_tizen>
 public WipeEffect(WipeType type, WipeDirection direction)
 {
     _type      = type;
     _direction = direction;
 }
Example #8
0
 public static void BeginWipe(Mobile from, WipeType type)
 {
     BoundingBoxPicker.Begin(from, (map, start, end) => DoWipe(from, map, start, end, type));
 }
Example #9
0
		public static void BeginWipe(Mobile from, WipeType type)
		{
			BoundingBoxPicker.Begin(from, new BoundingBoxCallback(WipeBox_Callback), type);
		}