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

@ -58,7 +58,7 @@ namespace Server.SkillHandlers
if ( range > 0 )
{
IPooledEnumerable inRange = src.Map.GetMobilesInRange( p, range );
IPooledEnumerable<Mobile> inRange = src.Map.GetMobilesInRange( p, range );
foreach ( Mobile trg in inRange )
{
@ -83,23 +83,18 @@ namespace Server.SkillHandlers
if ( Faction.Find( src ) != null )
{
IPooledEnumerable itemsInRange = src.Map.GetItemsInRange( p, range );
IPooledEnumerable<BaseFactionTrap> itemsInRange = src.Map.GetItemsInRange<BaseFactionTrap>( p, range );
foreach ( Item item in itemsInRange )
foreach ( BaseFactionTrap trap in itemsInRange )
{
if ( item is BaseFactionTrap )
if ( src.CheckTargetSkill( SkillName.DetectHidden, trap, 80.0, 100.0 ) )
{
BaseFactionTrap trap = (BaseFactionTrap) item;
src.SendLocalizedMessage( 1042712, true, " " + (trap.Faction == null ? "" : trap.Faction.Definition.FriendlyName) ); // You reveal a trap placed by a faction:
if ( src.CheckTargetSkill( SkillName.DetectHidden, trap, 80.0, 100.0 ) )
{
src.SendLocalizedMessage( 1042712, true, " " + (trap.Faction == null ? "" : trap.Faction.Definition.FriendlyName) ); // You reveal a trap placed by a faction:
trap.Visible = true;
trap.BeginConceal();
trap.Visible = true;
trap.BeginConceal();
foundAnyone = true;
}
foundAnyone = true;
}
}