Adds better type support for pooled enumerables. Refactors code. (#16)
This commit is contained in:
parent
62b95f4d74
commit
b06f5bf60d
48 changed files with 252 additions and 243 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
|
||||
namespace Server.Commands.Generic
|
||||
|
|
@ -47,20 +48,16 @@ namespace Server.Commands.Generic
|
|||
if ( !CheckObjectTypes( from, command, ext, out items, out mobiles ) )
|
||||
return;
|
||||
|
||||
IPooledEnumerable eable;
|
||||
IPooledEnumerable<IEntity> eable;
|
||||
|
||||
if ( items && mobiles )
|
||||
eable = map.GetObjectsInBounds( rect );
|
||||
else if ( items )
|
||||
eable = map.GetItemsInBounds( rect );
|
||||
else if ( mobiles )
|
||||
eable = map.GetMobilesInBounds( rect );
|
||||
if (items || mobiles)
|
||||
eable = map.GetObjectsInBounds(rect, items, mobiles);
|
||||
else
|
||||
return;
|
||||
|
||||
ArrayList objs = new ArrayList();
|
||||
|
||||
foreach ( object obj in eable )
|
||||
foreach ( IEntity obj in eable )
|
||||
{
|
||||
if ( mobiles && obj is Mobile && !BaseCommand.IsAccessible( from, obj ) )
|
||||
continue;
|
||||
|
|
@ -81,4 +78,4 @@ namespace Server.Commands.Generic
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue