fix(core): Fixes type caching & cleanup (#422)

- [X] Fixes some issues with the type caching
- [X] Changes type check default to ignore case
- [X] Splits out type caching of insensitive and sensitive lists. This means less stuff to iterate through when checking a type against the string.
- [X] Adds an ArrayEnumerator, mostly for reference purposes (copy/paste as needed)
This commit is contained in:
Kamron Batman 2021-01-20 00:10:33 -08:00 • committed by GitHub
parent b921c38879
commit e869c105d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 253 additions and 96 deletions

View file

@ -567,7 +567,7 @@ namespace Server.Engines.Spawners
// Defrag taken care of in Spawn(), beforehand
// Count check taken care of in Spawn(), beforehand
var type = AssemblyHandler.FindFirstTypeForName(entry.SpawnedName);
var type = AssemblyHandler.FindTypeByName(entry.SpawnedName);
if (type == null)
{
@ -1027,7 +1027,7 @@ namespace Server.Engines.Spawners
Entries[i].SpawnedName = typeName;
}
if (AssemblyHandler.FindFirstTypeForName(typeName) == null)
if (AssemblyHandler.FindTypeByName(typeName) == null)
{
m_WarnTimer ??= new WarnTimer();
@ -1055,7 +1055,7 @@ namespace Server.Engines.Spawners
for (var j = 0; j < Entries.Count; j++)
{
if (AssemblyHandler.FindFirstTypeForName(Entries[j].SpawnedName) == e.GetType())
if (AssemblyHandler.FindTypeByName(Entries[j].SpawnedName) == e.GetType())
{
Entries[j].Spawned.Add(e);
Spawned.Add(e, Entries[j]);