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

@ -252,12 +252,12 @@ namespace Server.Items
if ( direct )
alchemyBonus = (int)(from.Skills.Alchemy.Value / (Core.AOS ? 5 : 10));
IPooledEnumerable eable = LeveledExplosion ? (IPooledEnumerable)map.GetObjectsInRange( loc, ExplosionRange ) : (IPooledEnumerable)map.GetMobilesInRange( loc, ExplosionRange );
ArrayList toExplode = new ArrayList();
IPooledEnumerable<IEntity> eable = map.GetObjectsInRange(loc, ExplosionRange, LeveledExplosion, true);
List<IEntity> toExplode = new List<IEntity>();
int toDamage = 0;
foreach ( object o in eable )
foreach ( IEntity o in eable )
{
if ( o is Mobile && (from == null || (SpellHelper.ValidIndirectTarget( from, (Mobile)o ) && from.CanBeHarmful( (Mobile)o, false ))))
{
@ -306,4 +306,4 @@ namespace Server.Items
}
}
}
}
}