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

@ -642,13 +642,13 @@ namespace Server.Items
{
Item[] typedItems = FindItemsByType( types[i], recurse );
ArrayList groups = new ArrayList();
List<List<Item>> groups = new List<List<Item>>();
int idx = 0;
while ( idx < typedItems.Length )
{
Item a = typedItems[idx++];
ArrayList group = new ArrayList();
List<Item> group = new List<Item>();
group.Add( a );
@ -675,7 +675,7 @@ namespace Server.Items
for ( int j = 0; j < groups.Count; ++j )
{
items[i][j] = (Item[])(((ArrayList)groups[j]).ToArray( typeof( Item ) ));
items[i][j] = groups[j].ToArray();
for ( int k = 0; k < items[i][j].Length; ++k )
totals[i][j] += items[i][j][k].Amount;

View file

@ -536,34 +536,26 @@ namespace Server
}
}
public ArrayList GetTilesAt( Point2D p, bool items, bool land, bool statics )
public List<Tile> GetTilesAt( Point2D p, bool items, bool land, bool statics )
{
ArrayList list = new ArrayList();
List<Tile> list = new List<Tile>();
if ( this == Map.Internal )
return list;
if ( land )
{
list.Add( Tiles.GetLandTile( p.m_X, p.m_Y ) );
}
if ( statics )
{
list.AddRange( Tiles.GetStaticTiles( p.m_X, p.m_Y, true ) );
}
if ( items )
{
Sector sector = GetSector( p );
foreach ( Item item in sector.Items )
{
if ( item.AtWorldPoint( p.m_X, p.m_Y ) )
{
list.Add( new Tile( (short) ( ( item.ItemID & 0x3FFF ) + 0x4000 ), (sbyte) item.Z ) );
}
}
}
return list;