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
|
|
@ -128,7 +128,7 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
IPooledEnumerable eable = this.GetClientsInRange( SecureRange );
|
||||
IPooledEnumerable<NetState> eable = this.GetClientsInRange( SecureRange );
|
||||
|
||||
foreach ( NetState state in eable )
|
||||
{
|
||||
|
|
@ -214,4 +214,4 @@ namespace Server.Items
|
|||
m_Safe = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
|
|
@ -84,10 +84,10 @@ namespace Server.Items
|
|||
from.PlaySound( 0x15F );
|
||||
Effects.SendPacket( from, from.Map, new HuedEffect( EffectType.Moving, from.Serial, Serial.Zero, 0x36D4, from.Location, loc, 5, 0, false, true, 0, 0 ) );
|
||||
|
||||
ArrayList targets = new ArrayList();
|
||||
List<Mobile> targets = new List<Mobile>();
|
||||
bool playerVsPlayer = false;
|
||||
|
||||
IPooledEnumerable eable = from.Map.GetMobilesInRange( new Point3D( loc ), 2 );
|
||||
IPooledEnumerable<Mobile> eable = from.Map.GetMobilesInRange( new Point3D( loc ), 2 );
|
||||
|
||||
foreach ( Mobile m in eable )
|
||||
{
|
||||
|
|
@ -222,4 +222,4 @@ namespace Server.Items
|
|||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue