mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
DatItems don't know about replacing fields
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Core.Tools;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
@@ -106,36 +103,5 @@ namespace SabreTools.DatItems
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Sorting and Merging
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void ReplaceFields(
|
||||
DatItem item,
|
||||
List<DatItemField> datItemFields,
|
||||
List<MachineField> machineFields)
|
||||
{
|
||||
// Replace common fields first
|
||||
base.ReplaceFields(item, datItemFields, machineFields);
|
||||
|
||||
// If we don't have a SoftwareList to replace from, ignore specific fields
|
||||
if (item.ItemType != ItemType.SoftwareList)
|
||||
return;
|
||||
|
||||
// Cast for easier access
|
||||
SoftwareList newItem = item as SoftwareList;
|
||||
|
||||
// Replace the fields
|
||||
if (datItemFields.Contains(DatItemField.Name))
|
||||
Name = newItem.Name;
|
||||
|
||||
if (datItemFields.Contains(DatItemField.SoftwareListStatus))
|
||||
Status = newItem.Status;
|
||||
|
||||
if (datItemFields.Contains(DatItemField.Filter))
|
||||
Filter = newItem.Filter;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user