Value is only part of certain items

This is yet another boilerplate reduction AS WELL AS a reduction for unnecessary field names (mostly due to my misunderstanding of my own implementation)
This commit is contained in:
Matt Nadareski
2020-09-03 11:48:30 -07:00
parent 47c2c1d227
commit 6f72416947
40 changed files with 119 additions and 191 deletions

View File

@@ -230,7 +230,7 @@ namespace SabreTools.Library.DatFiles
Tag = reader.GetAttribute("tag"), Tag = reader.GetAttribute("tag"),
Mask = reader.GetAttribute("mask"), Mask = reader.GetAttribute("mask"),
Relation = reader.GetAttribute("relation"), Relation = reader.GetAttribute("relation"),
ConditionValue = reader.GetAttribute("value"), Value = reader.GetAttribute("value"),
Source = new Source Source = new Source
{ {

View File

@@ -1478,7 +1478,7 @@ namespace SabreTools.Library.DatFiles
xtw.WriteStartElement("file"); xtw.WriteStartElement("file");
xtw.WriteAttributeString("type", "info"); xtw.WriteAttributeString("type", "info");
xtw.WriteRequiredAttributeString("name", info.Name); xtw.WriteRequiredAttributeString("name", info.Name);
xtw.WriteRequiredAttributeString("value", info.InfoValue); xtw.WriteRequiredAttributeString("value", info.Value);
xtw.WriteEndElement(); xtw.WriteEndElement();
break; break;

View File

@@ -142,7 +142,7 @@ namespace SabreTools.Library.DatFiles
ParseAddHelper(new Info ParseAddHelper(new Info
{ {
Name = reader.GetAttribute("name"), Name = reader.GetAttribute("name"),
InfoValue = reader.GetAttribute("value"), Value = reader.GetAttribute("value"),
Source = new Source Source = new Source
{ {
@@ -741,7 +741,7 @@ namespace SabreTools.Library.DatFiles
var info = datItem as Info; var info = datItem as Info;
xtw.WriteStartElement("info"); xtw.WriteStartElement("info");
xtw.WriteRequiredAttributeString("name", info.Name); xtw.WriteRequiredAttributeString("name", info.Name);
xtw.WriteRequiredAttributeString("value", info.InfoValue); xtw.WriteRequiredAttributeString("value", info.Value);
xtw.WriteEndElement(); xtw.WriteEndElement();
break; break;

View File

@@ -107,7 +107,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -70,7 +70,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -83,7 +83,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -101,7 +101,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -38,7 +38,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -112,7 +112,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -36,7 +36,7 @@ namespace SabreTools.Library.DatItems
/// Condition value /// Condition value
/// </summary> /// </summary>
[JsonProperty("value", DefaultValueHandling = DefaultValueHandling.Ignore)] [JsonProperty("value", DefaultValueHandling = DefaultValueHandling.Ignore)]
public string ConditionValue { get; set; } public string Value { get; set; }
#endregion #endregion
@@ -67,10 +67,10 @@ namespace SabreTools.Library.DatItems
else if (mappings.Keys.Contains(Field.DatItem_Condition_Relation)) else if (mappings.Keys.Contains(Field.DatItem_Condition_Relation))
Relation = mappings[Field.DatItem_Condition_Relation]; Relation = mappings[Field.DatItem_Condition_Relation];
if (mappings.Keys.Contains(Field.DatItem_ConditionValue)) if (mappings.Keys.Contains(Field.DatItem_Value))
ConditionValue = mappings[Field.DatItem_ConditionValue]; Value = mappings[Field.DatItem_Value];
else if (mappings.Keys.Contains(Field.DatItem_Condition_Value)) else if (mappings.Keys.Contains(Field.DatItem_Condition_Value))
ConditionValue = mappings[Field.DatItem_Condition_Value]; Value = mappings[Field.DatItem_Condition_Value];
} }
#endregion #endregion
@@ -105,7 +105,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,
@@ -115,7 +114,7 @@ namespace SabreTools.Library.DatItems
Tag = this.Tag, Tag = this.Tag,
Mask = this.Mask, Mask = this.Mask,
Relation = this.Relation, Relation = this.Relation,
ConditionValue = this.ConditionValue, Value = this.Value,
}; };
} }
@@ -136,7 +135,7 @@ namespace SabreTools.Library.DatItems
return (Tag == newOther.Tag return (Tag == newOther.Tag
&& Mask == newOther.Mask && Mask == newOther.Mask
&& Relation == newOther.Relation && Relation == newOther.Relation
&& ConditionValue == newOther.ConditionValue); && Value == newOther.Value);
} }
#endregion #endregion
@@ -185,13 +184,13 @@ namespace SabreTools.Library.DatItems
return false; return false;
// Filter on value // Filter on value
if (filter.DatItem_ConditionValue.MatchesPositiveSet(ConditionValue) == false) if (filter.DatItem_Value.MatchesPositiveSet(Value) == false)
return false; return false;
if (filter.DatItem_ConditionValue.MatchesNegativeSet(ConditionValue) == true) if (filter.DatItem_Value.MatchesNegativeSet(Value) == true)
return false; return false;
if (filter.DatItem_Condition_Value.MatchesPositiveSet(ConditionValue) == false) if (filter.DatItem_Condition_Value.MatchesPositiveSet(Value) == false)
return false; return false;
if (filter.DatItem_Condition_Value.MatchesNegativeSet(ConditionValue) == true) if (filter.DatItem_Condition_Value.MatchesNegativeSet(Value) == true)
return false; return false;
return true; return true;
@@ -222,10 +221,10 @@ namespace SabreTools.Library.DatItems
else if (fields.Contains(Field.DatItem_Condition_Relation)) else if (fields.Contains(Field.DatItem_Condition_Relation))
Relation = null; Relation = null;
if (fields.Contains(Field.DatItem_ConditionValue)) if (fields.Contains(Field.DatItem_Value))
ConditionValue = null; Value = null;
else if (fields.Contains(Field.DatItem_Condition_Value)) else if (fields.Contains(Field.DatItem_Condition_Value))
ConditionValue = null; Value = null;
} }
#endregion #endregion
@@ -265,10 +264,10 @@ namespace SabreTools.Library.DatItems
else if (fields.Contains(Field.DatItem_Condition_Relation)) else if (fields.Contains(Field.DatItem_Condition_Relation))
Relation = newItem.Relation; Relation = newItem.Relation;
if (fields.Contains(Field.DatItem_ConditionValue)) if (fields.Contains(Field.DatItem_Value))
ConditionValue = newItem.ConditionValue; Value = newItem.Value;
else if (fields.Contains(Field.DatItem_Condition_Value)) else if (fields.Contains(Field.DatItem_Condition_Value))
ConditionValue = newItem.ConditionValue; Value = newItem.Value;
} }
#endregion #endregion

View File

@@ -146,7 +146,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -170,7 +170,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -104,12 +104,6 @@ namespace SabreTools.Library.DatItems
#region SoftwareList Fields #region SoftwareList Fields
/// <summary>
/// SoftwareList value associated with the item
/// </summary>
[JsonProperty("value", DefaultValueHandling = DefaultValueHandling.Ignore)]
public string Value { get; set; }
/// <summary> /// <summary>
/// Loading flag /// Loading flag
/// </summary> /// </summary>
@@ -178,11 +172,6 @@ namespace SabreTools.Library.DatItems
Field.DatItem_Feature_Name, Field.DatItem_Feature_Name,
Field.DatItem_Feature_Value, Field.DatItem_Feature_Value,
Field.DatItem_AreaName,
Field.DatItem_AreaSize,
Field.DatItem_AreaWidth,
Field.DatItem_AreaEndianness,
Field.DatItem_Value,
Field.DatItem_LoadFlag, Field.DatItem_LoadFlag,
#endregion #endregion
@@ -211,6 +200,13 @@ namespace SabreTools.Library.DatItems
Field.DatItem_Optional, Field.DatItem_Optional,
Field.DatItem_Inverted, Field.DatItem_Inverted,
// Rom (SoftwareList)
Field.DatItem_AreaName,
Field.DatItem_AreaSize,
Field.DatItem_AreaWidth,
Field.DatItem_AreaEndianness,
Field.DatItem_Value,
// Disk // Disk
Field.DatItem_Index, Field.DatItem_Index,
Field.DatItem_Writable, Field.DatItem_Writable,
@@ -373,12 +369,6 @@ namespace SabreTools.Library.DatItems
#region SoftwareList #region SoftwareList
// TODO: Add DatItem_Part*
// TODO: Add DatItem_Feature*
if (mappings.Keys.Contains(Field.DatItem_Value))
Value = mappings[Field.DatItem_Value];
if (mappings.Keys.Contains(Field.DatItem_LoadFlag)) if (mappings.Keys.Contains(Field.DatItem_LoadFlag))
LoadFlag = mappings[Field.DatItem_LoadFlag]; LoadFlag = mappings[Field.DatItem_LoadFlag];
@@ -763,12 +753,6 @@ namespace SabreTools.Library.DatItems
#region SoftwareList #region SoftwareList
// Filter on softwarelist value
if (filter.DatItem_Value.MatchesPositiveSet(Value) == false)
return false;
if (filter.DatItem_Value.MatchesNegativeSet(Value) == true)
return false;
// Filter on load flag // Filter on load flag
if (filter.DatItem_LoadFlag.MatchesPositiveSet(LoadFlag) == false) if (filter.DatItem_LoadFlag.MatchesPositiveSet(LoadFlag) == false)
return false; return false;
@@ -820,9 +804,6 @@ namespace SabreTools.Library.DatItems
#region SoftwareList #region SoftwareList
if (fields.Contains(Field.DatItem_Value))
Value = null;
if (fields.Contains(Field.DatItem_LoadFlag)) if (fields.Contains(Field.DatItem_LoadFlag))
LoadFlag = null; LoadFlag = null;
@@ -947,9 +928,6 @@ namespace SabreTools.Library.DatItems
#region SoftwareList #region SoftwareList
if (fields.Contains(Field.DatItem_Value))
Value = item.Value;
if (fields.Contains(Field.DatItem_LoadFlag)) if (fields.Contains(Field.DatItem_LoadFlag))
LoadFlag = item.LoadFlag; LoadFlag = item.LoadFlag;

View File

@@ -121,7 +121,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -83,7 +83,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -137,7 +137,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -218,7 +218,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,
@@ -260,7 +259,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -187,7 +187,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -103,7 +103,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -263,11 +263,6 @@ namespace SabreTools.Library.DatItems
DatItem_Feature_Name, DatItem_Feature_Name,
DatItem_Feature_Value, DatItem_Feature_Value,
DatItem_AreaName,
DatItem_AreaSize,
DatItem_AreaWidth,
DatItem_AreaEndianness,
DatItem_Value,
DatItem_LoadFlag, DatItem_LoadFlag,
#endregion #endregion
@@ -296,6 +291,13 @@ namespace SabreTools.Library.DatItems
DatItem_Optional, DatItem_Optional,
DatItem_Inverted, DatItem_Inverted,
// Rom (SoftwareList)
DatItem_AreaName,
DatItem_AreaSize,
DatItem_AreaWidth,
DatItem_AreaEndianness,
DatItem_Value,
// Disk // Disk
DatItem_Index, DatItem_Index,
DatItem_Writable, DatItem_Writable,
@@ -324,7 +326,6 @@ namespace SabreTools.Library.DatItems
DatItem_Clock, DatItem_Clock,
// Condition // Condition
DatItem_ConditionValue,
DatItem_Relation, DatItem_Relation,
// Configuration.Locations // Configuration.Locations
@@ -386,9 +387,6 @@ namespace SabreTools.Library.DatItems
DatItem_FeatureStatus, DatItem_FeatureStatus,
DatItem_FeatureOverall, DatItem_FeatureOverall,
// Info
DatItem_InfoValue,
// Inputs // Inputs
DatItem_Service, DatItem_Service,
DatItem_Tilt, DatItem_Tilt,
@@ -420,9 +418,6 @@ namespace SabreTools.Library.DatItems
// Release // Release
DatItem_Language, DatItem_Language,
// SharedFeature
DatItem_SharedFeatureValue,
// Slot.SlotOptions // Slot.SlotOptions
DatItem_SlotOptions, DatItem_SlotOptions,
DatItem_SlotOption_Name, DatItem_SlotOption_Name,

View File

@@ -83,7 +83,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -93,7 +93,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -25,7 +25,7 @@ namespace SabreTools.Library.DatItems
/// Information value /// Information value
/// </summary> /// </summary>
[JsonProperty("value")] [JsonProperty("value")]
public string InfoValue { get; set; } public string Value { get; set; }
#endregion #endregion
@@ -53,8 +53,8 @@ namespace SabreTools.Library.DatItems
if (mappings.Keys.Contains(Field.DatItem_Name)) if (mappings.Keys.Contains(Field.DatItem_Name))
Name = mappings[Field.DatItem_Name]; Name = mappings[Field.DatItem_Name];
if (mappings.Keys.Contains(Field.DatItem_InfoValue)) if (mappings.Keys.Contains(Field.DatItem_Value))
InfoValue = mappings[Field.DatItem_InfoValue]; Value = mappings[Field.DatItem_Value];
} }
#endregion #endregion
@@ -91,14 +91,13 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,
Source = this.Source.Clone() as Source, Source = this.Source.Clone() as Source,
Remove = this.Remove, Remove = this.Remove,
InfoValue = this.InfoValue, Value = this.Value,
}; };
} }
@@ -116,7 +115,7 @@ namespace SabreTools.Library.DatItems
Info newOther = other as Info; Info newOther = other as Info;
// If the archive information matches // If the archive information matches
return (Name == newOther.Name && InfoValue == newOther.InfoValue); return (Name == newOther.Name && Value == newOther.Value);
} }
#endregion #endregion
@@ -168,9 +167,9 @@ namespace SabreTools.Library.DatItems
return false; return false;
// Filter on info value // Filter on info value
if (filter.DatItem_InfoValue.MatchesPositiveSet(InfoValue) == false) if (filter.DatItem_Value.MatchesPositiveSet(Value) == false)
return false; return false;
if (filter.DatItem_InfoValue.MatchesNegativeSet(InfoValue) == true) if (filter.DatItem_Value.MatchesNegativeSet(Value) == true)
return false; return false;
return true; return true;
@@ -189,8 +188,8 @@ namespace SabreTools.Library.DatItems
if (fields.Contains(Field.DatItem_Name)) if (fields.Contains(Field.DatItem_Name))
Name = null; Name = null;
if (fields.Contains(Field.DatItem_InfoValue)) if (fields.Contains(Field.DatItem_Value))
InfoValue = null; Value = null;
} }
/// <summary> /// <summary>
@@ -228,8 +227,8 @@ namespace SabreTools.Library.DatItems
if (fields.Contains(Field.DatItem_Name)) if (fields.Contains(Field.DatItem_Name))
Name = newItem.Name; Name = newItem.Name;
if (fields.Contains(Field.DatItem_InfoValue)) if (fields.Contains(Field.DatItem_Value))
InfoValue = newItem.InfoValue; Value = newItem.Value;
} }
#endregion #endregion

View File

@@ -105,7 +105,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -92,7 +92,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -100,7 +100,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -148,7 +148,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,
@@ -182,7 +181,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -80,7 +80,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -101,7 +101,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -123,7 +123,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -185,6 +185,12 @@ namespace SabreTools.Library.DatItems
[JsonProperty("part", DefaultValueHandling = DefaultValueHandling.Ignore)] [JsonProperty("part", DefaultValueHandling = DefaultValueHandling.Ignore)]
public Part Part { get; set; } public Part Part { get; set; }
/// <summary>
/// SoftwareList value associated with the item
/// </summary>
[JsonProperty("value", DefaultValueHandling = DefaultValueHandling.Ignore)]
public string Value { get; set; }
#endregion #endregion
#endregion // Fields #endregion // Fields
@@ -210,6 +216,9 @@ namespace SabreTools.Library.DatItems
base.SetFields(mappings); base.SetFields(mappings);
// Handle Rom-specific fields // Handle Rom-specific fields
#region Common
if (mappings.Keys.Contains(Field.DatItem_Name)) if (mappings.Keys.Contains(Field.DatItem_Name))
Name = mappings[Field.DatItem_Name]; Name = mappings[Field.DatItem_Name];
@@ -266,6 +275,10 @@ namespace SabreTools.Library.DatItems
if (mappings.Keys.Contains(Field.DatItem_Inverted)) if (mappings.Keys.Contains(Field.DatItem_Inverted))
Inverted = mappings[Field.DatItem_Optional].AsYesNo(); Inverted = mappings[Field.DatItem_Optional].AsYesNo();
#endregion
#region SoftwareList
if (mappings.Keys.Contains(Field.DatItem_AreaName)) if (mappings.Keys.Contains(Field.DatItem_AreaName))
{ {
if (DataArea == null) if (DataArea == null)
@@ -298,6 +311,11 @@ namespace SabreTools.Library.DatItems
DataArea.Endianness = mappings[Field.DatItem_AreaEndianness]; DataArea.Endianness = mappings[Field.DatItem_AreaEndianness];
} }
if (mappings.Keys.Contains(Field.DatItem_Value))
Value = mappings[Field.DatItem_Value];
#endregion
} }
#endregion #endregion
@@ -380,7 +398,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,
@@ -408,6 +425,7 @@ namespace SabreTools.Library.DatItems
DataArea = this.DataArea, DataArea = this.DataArea,
Part = this.Part, Part = this.Part,
Value = this.Value,
}; };
} }
@@ -754,6 +772,12 @@ namespace SabreTools.Library.DatItems
if (filter.DatItem_Part_Interface.MatchesNegativeSet(Part?.Interface) == true) if (filter.DatItem_Part_Interface.MatchesNegativeSet(Part?.Interface) == true)
return false; return false;
// Filter on value
if (filter.DatItem_Value.MatchesPositiveSet(Value) == false)
return false;
if (filter.DatItem_Value.MatchesNegativeSet(Value) == true)
return false;
#endregion #endregion
return true; return true;
@@ -862,6 +886,9 @@ namespace SabreTools.Library.DatItems
if (fields.Contains(Field.DatItem_Features) && Part != null) if (fields.Contains(Field.DatItem_Features) && Part != null)
Part.Features = null; Part.Features = null;
if (fields.Contains(Field.DatItem_Value))
Value = null;
#endregion #endregion
} }

View File

@@ -83,7 +83,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -25,7 +25,7 @@ namespace SabreTools.Library.DatItems
/// Setting value /// Setting value
/// </summary> /// </summary>
[JsonProperty("value", DefaultValueHandling = DefaultValueHandling.Ignore)] [JsonProperty("value", DefaultValueHandling = DefaultValueHandling.Ignore)]
public string SettingValue { get; set; } public string Value { get; set; }
/// <summary> /// <summary>
/// Determines if the setting is default or not /// Determines if the setting is default or not
@@ -66,7 +66,7 @@ namespace SabreTools.Library.DatItems
Name = mappings[Field.DatItem_Setting_Name]; Name = mappings[Field.DatItem_Setting_Name];
if (mappings.Keys.Contains(Field.DatItem_Setting_Value)) if (mappings.Keys.Contains(Field.DatItem_Setting_Value))
SettingValue = mappings[Field.DatItem_Setting_Value]; Value = mappings[Field.DatItem_Setting_Value];
if (mappings.Keys.Contains(Field.DatItem_Setting_Default)) if (mappings.Keys.Contains(Field.DatItem_Setting_Default))
Default = mappings[Field.DatItem_Setting_Default].AsYesNo(); Default = mappings[Field.DatItem_Setting_Default].AsYesNo();
@@ -115,14 +115,13 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,
Source = this.Source.Clone() as Source, Source = this.Source.Clone() as Source,
Remove = this.Remove, Remove = this.Remove,
SettingValue = this.SettingValue, Value = this.Value,
Default = this.Default, Default = this.Default,
Conditions = this.Conditions, Conditions = this.Conditions,
}; };
@@ -143,7 +142,7 @@ namespace SabreTools.Library.DatItems
// If the Setting information matches // If the Setting information matches
bool match = (Name == newOther.Name bool match = (Name == newOther.Name
&& SettingValue == newOther.SettingValue && Value == newOther.Value
&& Default == newOther.Default); && Default == newOther.Default);
if (!match) if (!match)
return match; return match;
@@ -209,9 +208,9 @@ namespace SabreTools.Library.DatItems
return false; return false;
// Filter on value // Filter on value
if (filter.DatItem_Setting_Value.MatchesPositiveSet(SettingValue) == false) if (filter.DatItem_Setting_Value.MatchesPositiveSet(Value) == false)
return false; return false;
if (filter.DatItem_Setting_Value.MatchesNegativeSet(SettingValue) == true) if (filter.DatItem_Setting_Value.MatchesNegativeSet(Value) == true)
return false; return false;
// Filter on default // Filter on default
@@ -249,7 +248,7 @@ namespace SabreTools.Library.DatItems
Name = null; Name = null;
if (fields.Contains(Field.DatItem_Setting_Value)) if (fields.Contains(Field.DatItem_Setting_Value))
SettingValue = null; Value = null;
if (fields.Contains(Field.DatItem_Setting_Default)) if (fields.Contains(Field.DatItem_Setting_Default))
Default = null; Default = null;
@@ -302,7 +301,7 @@ namespace SabreTools.Library.DatItems
Name = newItem.Name; Name = newItem.Name;
if (fields.Contains(Field.DatItem_Setting_Value)) if (fields.Contains(Field.DatItem_Setting_Value))
SettingValue = newItem.SettingValue; Value = newItem.Value;
if (fields.Contains(Field.DatItem_Setting_Default)) if (fields.Contains(Field.DatItem_Setting_Default))
Default = newItem.Default; Default = newItem.Default;

View File

@@ -25,7 +25,7 @@ namespace SabreTools.Library.DatItems
/// SharedFeature value /// SharedFeature value
/// </summary> /// </summary>
[JsonProperty("value")] [JsonProperty("value")]
public string SharedFeatureValue { get; set; } public string Value { get; set; }
#endregion #endregion
@@ -53,8 +53,8 @@ namespace SabreTools.Library.DatItems
if (mappings.Keys.Contains(Field.DatItem_Name)) if (mappings.Keys.Contains(Field.DatItem_Name))
Name = mappings[Field.DatItem_Name]; Name = mappings[Field.DatItem_Name];
if (mappings.Keys.Contains(Field.DatItem_SharedFeatureValue)) if (mappings.Keys.Contains(Field.DatItem_Value))
SharedFeatureValue = mappings[Field.DatItem_SharedFeatureValue]; Value = mappings[Field.DatItem_Value];
} }
#endregion #endregion
@@ -91,14 +91,13 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,
Source = this.Source.Clone() as Source, Source = this.Source.Clone() as Source,
Remove = this.Remove, Remove = this.Remove,
SharedFeatureValue = this.SharedFeatureValue, Value = this.Value,
}; };
} }
@@ -116,7 +115,7 @@ namespace SabreTools.Library.DatItems
SharedFeature newOther = other as SharedFeature; SharedFeature newOther = other as SharedFeature;
// If the archive information matches // If the archive information matches
return (Name == newOther.Name && SharedFeatureValue == newOther.SharedFeatureValue); return (Name == newOther.Name && Value == newOther.Value);
} }
#endregion #endregion
@@ -168,9 +167,9 @@ namespace SabreTools.Library.DatItems
return false; return false;
// Filter on info value // Filter on info value
if (filter.DatItem_SharedFeatureValue.MatchesPositiveSet(SharedFeatureValue) == false) if (filter.DatItem_Value.MatchesPositiveSet(Value) == false)
return false; return false;
if (filter.DatItem_SharedFeatureValue.MatchesNegativeSet(SharedFeatureValue) == true) if (filter.DatItem_Value.MatchesNegativeSet(Value) == true)
return false; return false;
return true; return true;
@@ -189,8 +188,8 @@ namespace SabreTools.Library.DatItems
if (fields.Contains(Field.DatItem_Name)) if (fields.Contains(Field.DatItem_Name))
Name = null; Name = null;
if (fields.Contains(Field.DatItem_SharedFeatureValue)) if (fields.Contains(Field.DatItem_Value))
SharedFeatureValue = null; Value = null;
} }
/// <summary> /// <summary>
@@ -228,8 +227,8 @@ namespace SabreTools.Library.DatItems
if (fields.Contains(Field.DatItem_Name)) if (fields.Contains(Field.DatItem_Name))
Name = newItem.Name; Name = newItem.Name;
if (fields.Contains(Field.DatItem_SharedFeatureValue)) if (fields.Contains(Field.DatItem_Value))
SharedFeatureValue = newItem.SharedFeatureValue; Value = newItem.Value;
} }
#endregion #endregion

View File

@@ -91,7 +91,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -100,7 +100,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -103,7 +103,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -70,7 +70,6 @@ namespace SabreTools.Library.DatItems
Remark = this.Remark, Remark = this.Remark,
Boot = this.Boot, Boot = this.Boot,
Value = this.Value,
LoadFlag = this.LoadFlag, LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine, Machine = this.Machine.Clone() as Machine,

View File

@@ -128,11 +128,6 @@ namespace SabreTools.Library.Filtering
public FilterItem<string> DatItem_Feature_Name { get; private set; } = new FilterItem<string>(); public FilterItem<string> DatItem_Feature_Name { get; private set; } = new FilterItem<string>();
public FilterItem<string> DatItem_Feature_Value { get; private set; } = new FilterItem<string>(); public FilterItem<string> DatItem_Feature_Value { get; private set; } = new FilterItem<string>();
public FilterItem<string> DatItem_AreaName { get; private set; } = new FilterItem<string>();
public FilterItem<long?> DatItem_AreaSize { get; private set; } = new FilterItem<long?>() { Positive = null, Negative = null, Neutral = null };
public FilterItem<string> DatItem_AreaWidth { get; private set; } = new FilterItem<string>();
public FilterItem<string> DatItem_AreaEndianness { get; private set; } = new FilterItem<string>();
public FilterItem<string> DatItem_Value { get; private set; } = new FilterItem<string>();
public FilterItem<string> DatItem_LoadFlag { get; private set; } = new FilterItem<string>(); public FilterItem<string> DatItem_LoadFlag { get; private set; } = new FilterItem<string>();
#endregion #endregion
@@ -161,6 +156,13 @@ namespace SabreTools.Library.Filtering
public FilterItem<bool?> DatItem_Optional { get; private set; } = new FilterItem<bool?>() { Neutral = null }; public FilterItem<bool?> DatItem_Optional { get; private set; } = new FilterItem<bool?>() { Neutral = null };
public FilterItem<bool?> DatItem_Inverted { get; private set; } = new FilterItem<bool?>(); public FilterItem<bool?> DatItem_Inverted { get; private set; } = new FilterItem<bool?>();
// Rom (SoftwareList)
public FilterItem<string> DatItem_AreaName { get; private set; } = new FilterItem<string>();
public FilterItem<long?> DatItem_AreaSize { get; private set; } = new FilterItem<long?>() { Positive = null, Negative = null, Neutral = null };
public FilterItem<string> DatItem_AreaWidth { get; private set; } = new FilterItem<string>();
public FilterItem<string> DatItem_AreaEndianness { get; private set; } = new FilterItem<string>();
public FilterItem<string> DatItem_Value { get; private set; } = new FilterItem<string>();
// Disk // Disk
public FilterItem<string> DatItem_Index { get; private set; } = new FilterItem<string>(); public FilterItem<string> DatItem_Index { get; private set; } = new FilterItem<string>();
public FilterItem<bool?> DatItem_Writable { get; private set; } = new FilterItem<bool?>() { Neutral = null }; public FilterItem<bool?> DatItem_Writable { get; private set; } = new FilterItem<bool?>() { Neutral = null };
@@ -190,7 +192,6 @@ namespace SabreTools.Library.Filtering
// Condition // Condition
public FilterItem<string> DatItem_Relation { get; private set; } = new FilterItem<string>(); public FilterItem<string> DatItem_Relation { get; private set; } = new FilterItem<string>();
public FilterItem<string> DatItem_ConditionValue { get; private set; } = new FilterItem<string>();
// Configuration.Locations // Configuration.Locations
public FilterItem<bool?> DatItem_Locations { get; private set; } = new FilterItem<bool?>() { Neutral = null }; public FilterItem<bool?> DatItem_Locations { get; private set; } = new FilterItem<bool?>() { Neutral = null };
@@ -251,9 +252,6 @@ namespace SabreTools.Library.Filtering
public FilterItem<FeatureStatus> DatItem_FeatureStatus { get; private set; } = new FilterItem<FeatureStatus>() { Positive = FeatureStatus.NULL, Negative = FeatureStatus.NULL }; public FilterItem<FeatureStatus> DatItem_FeatureStatus { get; private set; } = new FilterItem<FeatureStatus>() { Positive = FeatureStatus.NULL, Negative = FeatureStatus.NULL };
public FilterItem<FeatureStatus> DatItem_FeatureOverall { get; private set; } = new FilterItem<FeatureStatus>() { Positive = FeatureStatus.NULL, Negative = FeatureStatus.NULL }; public FilterItem<FeatureStatus> DatItem_FeatureOverall { get; private set; } = new FilterItem<FeatureStatus>() { Positive = FeatureStatus.NULL, Negative = FeatureStatus.NULL };
// Info
public FilterItem<string> DatItem_InfoValue { get; private set; } = new FilterItem<string>();
// Input // Input
public FilterItem<bool?> DatItem_Service { get; private set; } = new FilterItem<bool?>() { Neutral = null }; public FilterItem<bool?> DatItem_Service { get; private set; } = new FilterItem<bool?>() { Neutral = null };
public FilterItem<bool?> DatItem_Tilt { get; private set; } = new FilterItem<bool?>() { Neutral = null }; public FilterItem<bool?> DatItem_Tilt { get; private set; } = new FilterItem<bool?>() { Neutral = null };
@@ -285,9 +283,6 @@ namespace SabreTools.Library.Filtering
// Release // Release
public FilterItem<string> DatItem_Language { get; private set; } = new FilterItem<string>(); public FilterItem<string> DatItem_Language { get; private set; } = new FilterItem<string>();
// SharedFeature
public FilterItem<string> DatItem_SharedFeatureValue { get; private set; } = new FilterItem<string>();
// Slots.SlotOptions // Slots.SlotOptions
public FilterItem<bool?> DatItem_SlotOptions { get; private set; } = new FilterItem<bool?>() { Neutral = null }; public FilterItem<bool?> DatItem_SlotOptions { get; private set; } = new FilterItem<bool?>() { Neutral = null };
public FilterItem<string> DatItem_SlotOption_Name { get; private set; } = new FilterItem<string>(); public FilterItem<string> DatItem_SlotOption_Name { get; private set; } = new FilterItem<string>();
@@ -1140,13 +1135,6 @@ namespace SabreTools.Library.Filtering
DatItem_Relation.PositiveSet.Add(value); DatItem_Relation.PositiveSet.Add(value);
break; break;
case Field.DatItem_ConditionValue:
if (negate)
DatItem_ConditionValue.NegativeSet.Add(value);
else
DatItem_ConditionValue.PositiveSet.Add(value);
break;
// Configurations.Locations // Configurations.Locations
case Field.DatItem_Locations: case Field.DatItem_Locations:
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase)) if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
@@ -1443,14 +1431,6 @@ namespace SabreTools.Library.Filtering
DatItem_FeatureOverall.Positive |= value.AsFeatureStatus(); DatItem_FeatureOverall.Positive |= value.AsFeatureStatus();
break; break;
// Info
case Field.DatItem_InfoValue:
if (negate)
DatItem_InfoValue.NegativeSet.Add(value);
else
DatItem_InfoValue.PositiveSet.Add(value);
break;
// Input // Input
case Field.DatItem_Service: case Field.DatItem_Service:
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase)) if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
@@ -1603,14 +1583,6 @@ namespace SabreTools.Library.Filtering
DatItem_Language.PositiveSet.Add(value); DatItem_Language.PositiveSet.Add(value);
break; break;
// SharedFeature
case Field.DatItem_SharedFeatureValue:
if (negate)
DatItem_SharedFeatureValue.NegativeSet.Add(value);
else
DatItem_SharedFeatureValue.PositiveSet.Add(value);
break;
// Slots.SlotOptions // Slots.SlotOptions
case Field.DatItem_SlotOptions: case Field.DatItem_SlotOptions:
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase)) if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))

View File

@@ -734,25 +734,6 @@ namespace SabreTools.Library.Tools
case "feature_value": case "feature_value":
return Field.DatItem_Feature_Value; return Field.DatItem_Feature_Value;
case "areaname":
case "area_name":
return Field.DatItem_AreaName;
case "areasize":
case "area_size":
return Field.DatItem_AreaSize;
case "areawidth":
case "area_width":
return Field.DatItem_AreaWidth;
case "areaendinanness":
case "area_endianness":
return Field.DatItem_AreaEndianness;
case "value":
return Field.DatItem_Value;
case "loadflag": case "loadflag":
case "load_flag": case "load_flag":
return Field.DatItem_LoadFlag; return Field.DatItem_LoadFlag;
@@ -839,6 +820,26 @@ namespace SabreTools.Library.Tools
case "inverted": case "inverted":
return Field.DatItem_Inverted; return Field.DatItem_Inverted;
// Rom (SoftwareList)
case "areaname":
case "area_name":
return Field.DatItem_AreaName;
case "areasize":
case "area_size":
return Field.DatItem_AreaSize;
case "areawidth":
case "area_width":
return Field.DatItem_AreaWidth;
case "areaendinanness":
case "area_endianness":
return Field.DatItem_AreaEndianness;
case "value":
return Field.DatItem_Value;
// Disk // Disk
case "index": case "index":
return Field.DatItem_Index; return Field.DatItem_Index;
@@ -894,9 +895,6 @@ namespace SabreTools.Library.Tools
case "relation": case "relation":
return Field.DatItem_Relation; return Field.DatItem_Relation;
case "conditionvalue":
return Field.DatItem_ConditionValue;
// Configuration // Configuration
case "locations": case "locations":
return Field.DatItem_Locations; return Field.DatItem_Locations;
@@ -1026,10 +1024,6 @@ namespace SabreTools.Library.Tools
case "featureoverall": case "featureoverall":
return Field.DatItem_FeatureOverall; return Field.DatItem_FeatureOverall;
// Info
case "infovalue":
return Field.DatItem_InfoValue;
// Input // Input
case "service": case "service":
return Field.DatItem_Service; return Field.DatItem_Service;
@@ -1097,10 +1091,6 @@ namespace SabreTools.Library.Tools
case "language": case "language":
return Field.DatItem_Language; return Field.DatItem_Language;
// SharedFeature
case "sharedfeaturevalue":
return Field.DatItem_SharedFeatureValue;
// Slot // Slot
case "slotoptions": case "slotoptions":
return Field.DatItem_SlotOptions; return Field.DatItem_SlotOptions;