mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
DatItems don't know about setting fields
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Core;
|
||||
@@ -108,64 +107,6 @@ namespace SabreTools.DatItems
|
||||
Name = name;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void SetFields(
|
||||
Dictionary<DatItemField, string> datItemMappings,
|
||||
Dictionary<MachineField, string> machineMappings)
|
||||
{
|
||||
// Set base fields
|
||||
base.SetFields(datItemMappings, machineMappings);
|
||||
|
||||
// Handle DipSwitch-specific fields
|
||||
|
||||
#region Common
|
||||
|
||||
if (datItemMappings.Keys.Contains(DatItemField.Name))
|
||||
Name = datItemMappings[DatItemField.Name];
|
||||
|
||||
if (datItemMappings.Keys.Contains(DatItemField.Tag))
|
||||
Tag = datItemMappings[DatItemField.Tag];
|
||||
|
||||
if (datItemMappings.Keys.Contains(DatItemField.Mask))
|
||||
Mask = datItemMappings[DatItemField.Mask];
|
||||
|
||||
if (ConditionsSpecified)
|
||||
{
|
||||
foreach (Condition condition in Conditions)
|
||||
{
|
||||
condition.SetFields(datItemMappings, machineMappings, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (LocationsSpecified)
|
||||
{
|
||||
foreach (Location location in Locations)
|
||||
{
|
||||
location.SetFields(datItemMappings, machineMappings);
|
||||
}
|
||||
}
|
||||
|
||||
if (ValuesSpecified)
|
||||
{
|
||||
foreach (Setting value in Values)
|
||||
{
|
||||
value.SetFields(datItemMappings, machineMappings);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region SoftwareList
|
||||
|
||||
// Handle Part-specific fields
|
||||
if (Part == null)
|
||||
Part = new Part();
|
||||
|
||||
Part.SetFields(datItemMappings, machineMappings);
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
Reference in New Issue
Block a user