Create and use FilterKey

This commit is contained in:
Matt Nadareski
2024-10-24 03:16:45 -04:00
parent 349d3d1a78
commit 14fc7777cb
9 changed files with 85 additions and 72 deletions

View File

@@ -208,9 +208,9 @@ namespace SabreTools.Filtering
/// Combine ExtraIni fields
/// </summary>
/// <returns>Mapping dictionary from machine name to field mapping</returns>
private Dictionary<string, Dictionary<string, string>> CombineExtras()
private Dictionary<string, Dictionary<FilterKey, string>> CombineExtras()
{
var machineMap = new Dictionary<string, Dictionary<string, string>>();
var machineMap = new Dictionary<string, Dictionary<FilterKey, string>>();
// Loop through each of the extras
foreach (ExtraIniItem item in Items)

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using SabreTools.Core.Filter;
using SabreTools.IO.Logging;
using SabreTools.IO.Readers;
@@ -13,17 +14,7 @@ namespace SabreTools.Filtering
/// Item type and field to update with INI information
/// </summary>
/// <remarks>Formatted like "ItemName.FieldName"</remarks>
public string Key => $"{_itemName}.{_fieldName}";
/// <summary>
/// Item type to update with INI information
/// </summary>
private readonly string _itemName;
/// <summary>
/// Field to update with INI information
/// </summary>
private readonly string _fieldName;
public readonly FilterKey Key;
/// <summary>
/// Mappings from machine names to value
@@ -36,8 +27,7 @@ namespace SabreTools.Filtering
public ExtraIniItem(string itemName, string fieldName)
{
_itemName = itemName;
_fieldName = fieldName;
Key = new FilterKey(itemName, fieldName);
}
#endregion