Adds better type support for pooled enumerables. Refactors code. (#16)

This commit is contained in:
Kamron Batman 2018-08-09 14:08:34 -07:00 committed by GitHub
parent 62b95f4d74
commit b06f5bf60d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
48 changed files with 252 additions and 243 deletions

View file

@ -176,18 +176,13 @@ namespace Server.Regions
{
BaseGuard useGuard = null;
IPooledEnumerable eable = focus.GetMobilesInRange( 8 );
foreach ( Mobile m in eable)
IPooledEnumerable<BaseGuard> eable = focus.GetMobilesInRange<BaseGuard>( 8 );
foreach (BaseGuard m in eable)
{
if ( m is BaseGuard )
if ( m.Focus == null ) // idling
{
BaseGuard g = (BaseGuard)m;
if ( g.Focus == null ) // idling
{
useGuard = g;
break;
}
useGuard = m;
break;
}
}
@ -322,7 +317,7 @@ namespace Server.Regions
if ( IsDisabled() )
return;
IPooledEnumerable eable = Map.GetMobilesInRange( p, 14 );
IPooledEnumerable<Mobile> eable = Map.GetMobilesInRange( p, 14 );
foreach ( Mobile m in eable )
{