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
|
|
@ -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
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue