fix(core): Removes some uses of Linq (#421)

- [X] Removes some uses of linq
- [X] Creates struct based enumerator for Skills
- [X] Creates a struct based enumerator for TypeCache
- [X] Changes HarvestDefinition to an init array instead of List
- [X] Changes HeritageTokenGump Response from List to Array
This commit is contained in:
Kamron Batman 2021-01-18 21:05:11 -08:00 committed by GitHub
parent 52356866ed
commit b921c38879
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 1006 additions and 507 deletions

View file

@ -2,7 +2,6 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using Server.ContextMenus;
using Server.Items;
@ -3619,28 +3618,27 @@ namespace Server
var eable = map.GetItemsInRange(p, 0);
var items = eable.Where(
item =>
var items = new List<Item>();
foreach (var item in eable)
{
if (item is BaseMulti || item.ItemID > TileData.MaxItemValue)
{
if (item is BaseMulti || item.ItemID > TileData.MaxItemValue)
{
return false;
}
var id = item.ItemData;
if (id.Surface)
{
var top = item.Z + id.CalcHeight;
if (top <= maxZ && top >= z)
{
z = top;
}
}
return true;
continue;
}
).ToList();
var id = item.ItemData;
if (id.Surface)
{
var top = item.Z + id.CalcHeight;
if (top <= maxZ && top >= z)
{
z = top;
}
}
items.Add(item);
}
eable.Free();