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

@ -873,7 +873,7 @@ namespace Server.Commands
bool res = false;
IPooledEnumerable eable;
IPooledEnumerable<Item> eable;
if ( srcItem is BaseDoor )
{
@ -1002,16 +1002,16 @@ namespace Server.Commands
if ( item is BaseDoor )
{
IPooledEnumerable eable = maps[j].GetItemsInRange( loc, 1 );
IPooledEnumerable<BaseDoor> eable = maps[j].GetItemsInRange<BaseDoor>( loc, 1 );
Type itemType = item.GetType();
foreach ( Item link in eable )
foreach ( BaseDoor link in eable )
{
if ( link != item && link.Z == item.Z && link.GetType() == itemType )
{
((BaseDoor)item).Link = (BaseDoor)link;
((BaseDoor)link).Link = (BaseDoor)item;
((BaseDoor)item).Link = link;
link.Link = (BaseDoor)item;
break;
}
}
@ -1151,4 +1151,4 @@ namespace Server.Commands
}
}
}
}
}