DatItems don't know about setting fields

This commit is contained in:
Matt Nadareski
2020-12-14 10:11:20 -08:00
parent 8a354e9156
commit f8b9dfa122
44 changed files with 923 additions and 1138 deletions

View File

@@ -142,18 +142,6 @@ namespace SabreTools.DatItems
{
}
/// <summary>
/// Set fields with given values
/// </summary>
/// <param name="datItemMappings">DatItem mappings dictionary</param>
/// <param name="machineMappings">Machine mappings dictionary</param>
/// TODO: Fix case where datItemMappings is null
public virtual void SetFields(
Dictionary<DatItemField, string> datItemMappings,
Dictionary<MachineField, string> machineMappings)
{
}
#endregion
#region Constructors
@@ -774,14 +762,14 @@ namespace SabreTools.DatItems
{
saveditem.Source = file.Source.Clone() as Source;
saveditem.CopyMachineInformation(file);
saveditem.SetFields(new Dictionary<DatItemField, string> { [DatItemField.Name] = file.GetName() }, null);
saveditem.SetName(file.GetName());
}
// If the current machine is a child of the new machine, use the new machine instead
if (saveditem.Machine.CloneOf == file.Machine.Name || saveditem.Machine.RomOf == file.Machine.Name)
{
saveditem.CopyMachineInformation(file);
saveditem.SetFields(new Dictionary<DatItemField, string> { [DatItemField.Name] = file.GetName() }, null);
saveditem.SetName(file.GetName());
}
break;
@@ -877,7 +865,7 @@ namespace SabreTools.DatItems
}
// Set the item name back to the datItem
datItem.SetFields(new Dictionary<DatItemField, string> { [DatItemField.Name] = datItemName }, null);
datItem.SetName(datItemName);
output.Add(datItem);
}