Handle known enumerable types better

This commit is contained in:
Matt Nadareski
2024-11-12 21:12:06 -05:00
parent 4b3955af77
commit a4da7f3657
19 changed files with 227 additions and 178 deletions

View File

@@ -478,7 +478,7 @@ namespace SabreTools.DatFiles.Formats
continue;
// Resolve the names in the block
items = [.. DatItem.ResolveNamesDB(items.ToList())];
items = [.. DatItem.ResolveNamesDB([.. items])];
for (int index = 0; index < items.Length; index++)
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using System;
using System.Collections.Generic;
using SabreTools.DatItems;
using SabreTools.DatItems.Formats;
@@ -122,9 +122,9 @@ namespace SabreTools.DatFiles.Formats
if (dipSwitch.ValuesSpecified)
{
var dipValues = dipSwitch.GetFieldValue<DipValue[]?>(Models.Metadata.DipSwitch.DipValueKey);
if (dipValues!.Any(dv => string.IsNullOrEmpty(dv.GetName())))
if (Array.Find(dipValues!, dv => string.IsNullOrEmpty(dv.GetName())) != null)
missingFields.Add(Models.Metadata.DipValue.NameKey);
if (dipValues!.Any(dv => string.IsNullOrEmpty(dv.GetStringFieldValue(Models.Metadata.DipValue.ValueKey))))
if (Array.Find(dipValues!, dv => string.IsNullOrEmpty(dv.GetStringFieldValue(Models.Metadata.DipValue.ValueKey))) != null)
missingFields.Add(Models.Metadata.DipValue.ValueKey);
}