Replace more direct accessors to ItemDictionary

This commit is contained in:
Matt Nadareski
2025-01-13 09:37:59 -05:00
parent 3c4de2cc07
commit c94d8d712f
5 changed files with 30 additions and 29 deletions

View File

@@ -387,7 +387,7 @@ namespace SabreTools.DatTools
blankRom.SetName(romname);
blankRom.SetFieldValue<Machine?>(DatItem.MachineKey, blankMachine);
datFile.Items["null"]?.Add(blankRom);
datFile.Add("null", blankRom);
#if NET40_OR_GREATER || NETCOREAPP
});
#else

View File

@@ -168,7 +168,7 @@ namespace SabreTools.DatTools
foreach (var key in itemDictionary.Keys)
{
List<DatItem>? items = itemDictionary[key];
List<DatItem>? items = itemDictionary.GetItemsForBucket(key);
if (items == null)
continue;

View File

@@ -797,7 +797,7 @@ namespace SabreTools.DatTools
foreach (string machine in keys)
{
// Get the current machine
var items = datFile.Items[machine];
var items = datFile.GetItemsForBucket(machine);
if (items == null || items.Count == 0)
{
_staticLogger.Error($"{machine} contains no items and will be skipped");