generic town criers, misc generics, region cleanups, container generic, yadda yadda

This commit is contained in:
mark 2006-06-24 17:56:49 +00:00
parent 03adafb13e
commit 90c2233e4c
16 changed files with 114 additions and 167 deletions

View file

@ -543,9 +543,9 @@ namespace Server.Multis
}
}
public ArrayList GetHouseEntities()
public List<IEntity> GetHouseEntities()
{
ArrayList list = new ArrayList();
List<IEntity> list = new List<IEntity>();
if ( MovingCrate != null )
MovingCrate.Hide();
@ -725,40 +725,38 @@ namespace Server.Multis
MovingCrate.DropItem( item );
}
public ArrayList GetItems()
public List<Item> GetItems()
{
if( this.Map == null || this.Map == Map.Internal )
return new ArrayList();
return new List<Item>();
Point2D start = new Point2D( this.X + Components.Min.X, this.Y + Components.Min.Y );
Point2D end = new Point2D( this.X + Components.Max.X + 1, this.Y + Components.Max.Y + 1 );
Rectangle2D rect = new Rectangle2D( start, end );
ArrayList list = new ArrayList();
List<Item> list = new List<Item>();
IPooledEnumerable eable = this.Map.GetItemsInBounds( rect );
foreach ( Item item in eable )
{
if ( item.Movable && IsInside( item ) )
list.Add( item );
}
eable.Free();
return list;
}
public ArrayList GetMobiles()
public List<Mobile> GetMobiles()
{
if( this.Map == null || this.Map == Map.Internal )
return new ArrayList();
return new List<Mobile>();
ArrayList list = new ArrayList();
List<Mobile> list = new List<Mobile>();
foreach ( Mobile mobile in Region.GetMobiles() )
{
if ( IsInside( mobile ) )
list.Add( mobile );
}
return list;
}

View file

@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Items;
using Server.Movement;
@ -144,9 +145,9 @@ namespace Server.Multis
public virtual BaseDockedBoat DockedBoat{ get{ return null; } }
private static ArrayList m_Instances = new ArrayList();
private static List<BaseBoat> m_Instances = new List<BaseBoat>();
public static ArrayList Boats{ get{ return m_Instances; } }
public static List<BaseBoat> Boats{ get{ return m_Instances; } }
public BaseBoat() : base( 0x4000 )
{
@ -1642,7 +1643,7 @@ namespace Server.Multis
public static void UpdateAllComponents()
{
for ( int i = m_Instances.Count - 1; i >= 0; --i )
((BaseBoat)m_Instances[i]).UpdateComponents();
m_Instances[i].UpdateComponents();
}
public static void Initialize()

View file

@ -200,17 +200,13 @@ namespace Server.Multis
m_InternalizeTimer = null;
}
ArrayList toRemove = new ArrayList();
List<Item> toRemove = new List<Item>();
foreach ( Item item in this.Items )
{
if ( item is PackingBox && item.Items.Count == 0 )
toRemove.Add( item );
}
foreach ( Item item in toRemove )
{
item.Delete();
}
if ( this.TotalItems == 0 )
Delete();