mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
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:
@@ -230,7 +230,7 @@ namespace SabreTools.Library.DatFiles
|
||||
Tag = reader.GetAttribute("tag"),
|
||||
Mask = reader.GetAttribute("mask"),
|
||||
Relation = reader.GetAttribute("relation"),
|
||||
ConditionValue = reader.GetAttribute("value"),
|
||||
Value = reader.GetAttribute("value"),
|
||||
|
||||
Source = new Source
|
||||
{
|
||||
|
||||
@@ -1478,7 +1478,7 @@ namespace SabreTools.Library.DatFiles
|
||||
xtw.WriteStartElement("file");
|
||||
xtw.WriteAttributeString("type", "info");
|
||||
xtw.WriteRequiredAttributeString("name", info.Name);
|
||||
xtw.WriteRequiredAttributeString("value", info.InfoValue);
|
||||
xtw.WriteRequiredAttributeString("value", info.Value);
|
||||
xtw.WriteEndElement();
|
||||
break;
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ namespace SabreTools.Library.DatFiles
|
||||
ParseAddHelper(new Info
|
||||
{
|
||||
Name = reader.GetAttribute("name"),
|
||||
InfoValue = reader.GetAttribute("value"),
|
||||
Value = reader.GetAttribute("value"),
|
||||
|
||||
Source = new Source
|
||||
{
|
||||
@@ -741,7 +741,7 @@ namespace SabreTools.Library.DatFiles
|
||||
var info = datItem as Info;
|
||||
xtw.WriteStartElement("info");
|
||||
xtw.WriteRequiredAttributeString("name", info.Name);
|
||||
xtw.WriteRequiredAttributeString("value", info.InfoValue);
|
||||
xtw.WriteRequiredAttributeString("value", info.Value);
|
||||
xtw.WriteEndElement();
|
||||
break;
|
||||
|
||||
|
||||
@@ -107,7 +107,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -70,7 +70,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -83,7 +83,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -101,7 +101,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -38,7 +38,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -112,7 +112,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Condition value
|
||||
/// </summary>
|
||||
[JsonProperty("value", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string ConditionValue { get; set; }
|
||||
public string Value { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -67,10 +67,10 @@ namespace SabreTools.Library.DatItems
|
||||
else if (mappings.Keys.Contains(Field.DatItem_Condition_Relation))
|
||||
Relation = mappings[Field.DatItem_Condition_Relation];
|
||||
|
||||
if (mappings.Keys.Contains(Field.DatItem_ConditionValue))
|
||||
ConditionValue = mappings[Field.DatItem_ConditionValue];
|
||||
if (mappings.Keys.Contains(Field.DatItem_Value))
|
||||
Value = mappings[Field.DatItem_Value];
|
||||
else if (mappings.Keys.Contains(Field.DatItem_Condition_Value))
|
||||
ConditionValue = mappings[Field.DatItem_Condition_Value];
|
||||
Value = mappings[Field.DatItem_Condition_Value];
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -105,7 +105,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
@@ -115,7 +114,7 @@ namespace SabreTools.Library.DatItems
|
||||
Tag = this.Tag,
|
||||
Mask = this.Mask,
|
||||
Relation = this.Relation,
|
||||
ConditionValue = this.ConditionValue,
|
||||
Value = this.Value,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -136,7 +135,7 @@ namespace SabreTools.Library.DatItems
|
||||
return (Tag == newOther.Tag
|
||||
&& Mask == newOther.Mask
|
||||
&& Relation == newOther.Relation
|
||||
&& ConditionValue == newOther.ConditionValue);
|
||||
&& Value == newOther.Value);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -185,13 +184,13 @@ namespace SabreTools.Library.DatItems
|
||||
return false;
|
||||
|
||||
// Filter on value
|
||||
if (filter.DatItem_ConditionValue.MatchesPositiveSet(ConditionValue) == false)
|
||||
if (filter.DatItem_Value.MatchesPositiveSet(Value) == false)
|
||||
return false;
|
||||
if (filter.DatItem_ConditionValue.MatchesNegativeSet(ConditionValue) == true)
|
||||
if (filter.DatItem_Value.MatchesNegativeSet(Value) == true)
|
||||
return false;
|
||||
if (filter.DatItem_Condition_Value.MatchesPositiveSet(ConditionValue) == false)
|
||||
if (filter.DatItem_Condition_Value.MatchesPositiveSet(Value) == false)
|
||||
return false;
|
||||
if (filter.DatItem_Condition_Value.MatchesNegativeSet(ConditionValue) == true)
|
||||
if (filter.DatItem_Condition_Value.MatchesNegativeSet(Value) == true)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -222,10 +221,10 @@ namespace SabreTools.Library.DatItems
|
||||
else if (fields.Contains(Field.DatItem_Condition_Relation))
|
||||
Relation = null;
|
||||
|
||||
if (fields.Contains(Field.DatItem_ConditionValue))
|
||||
ConditionValue = null;
|
||||
if (fields.Contains(Field.DatItem_Value))
|
||||
Value = null;
|
||||
else if (fields.Contains(Field.DatItem_Condition_Value))
|
||||
ConditionValue = null;
|
||||
Value = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -265,10 +264,10 @@ namespace SabreTools.Library.DatItems
|
||||
else if (fields.Contains(Field.DatItem_Condition_Relation))
|
||||
Relation = newItem.Relation;
|
||||
|
||||
if (fields.Contains(Field.DatItem_ConditionValue))
|
||||
ConditionValue = newItem.ConditionValue;
|
||||
if (fields.Contains(Field.DatItem_Value))
|
||||
Value = newItem.Value;
|
||||
else if (fields.Contains(Field.DatItem_Condition_Value))
|
||||
ConditionValue = newItem.ConditionValue;
|
||||
Value = newItem.Value;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -146,7 +146,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -170,7 +170,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -104,12 +104,6 @@ namespace SabreTools.Library.DatItems
|
||||
|
||||
#region SoftwareList Fields
|
||||
|
||||
/// <summary>
|
||||
/// SoftwareList value associated with the item
|
||||
/// </summary>
|
||||
[JsonProperty("value", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Loading flag
|
||||
/// </summary>
|
||||
@@ -178,11 +172,6 @@ namespace SabreTools.Library.DatItems
|
||||
Field.DatItem_Feature_Name,
|
||||
Field.DatItem_Feature_Value,
|
||||
|
||||
Field.DatItem_AreaName,
|
||||
Field.DatItem_AreaSize,
|
||||
Field.DatItem_AreaWidth,
|
||||
Field.DatItem_AreaEndianness,
|
||||
Field.DatItem_Value,
|
||||
Field.DatItem_LoadFlag,
|
||||
|
||||
#endregion
|
||||
@@ -211,6 +200,13 @@ namespace SabreTools.Library.DatItems
|
||||
Field.DatItem_Optional,
|
||||
Field.DatItem_Inverted,
|
||||
|
||||
// Rom (SoftwareList)
|
||||
Field.DatItem_AreaName,
|
||||
Field.DatItem_AreaSize,
|
||||
Field.DatItem_AreaWidth,
|
||||
Field.DatItem_AreaEndianness,
|
||||
Field.DatItem_Value,
|
||||
|
||||
// Disk
|
||||
Field.DatItem_Index,
|
||||
Field.DatItem_Writable,
|
||||
@@ -373,12 +369,6 @@ namespace SabreTools.Library.DatItems
|
||||
|
||||
#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))
|
||||
LoadFlag = mappings[Field.DatItem_LoadFlag];
|
||||
|
||||
@@ -763,12 +753,6 @@ namespace SabreTools.Library.DatItems
|
||||
|
||||
#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
|
||||
if (filter.DatItem_LoadFlag.MatchesPositiveSet(LoadFlag) == false)
|
||||
return false;
|
||||
@@ -820,9 +804,6 @@ namespace SabreTools.Library.DatItems
|
||||
|
||||
#region SoftwareList
|
||||
|
||||
if (fields.Contains(Field.DatItem_Value))
|
||||
Value = null;
|
||||
|
||||
if (fields.Contains(Field.DatItem_LoadFlag))
|
||||
LoadFlag = null;
|
||||
|
||||
@@ -947,9 +928,6 @@ namespace SabreTools.Library.DatItems
|
||||
|
||||
#region SoftwareList
|
||||
|
||||
if (fields.Contains(Field.DatItem_Value))
|
||||
Value = item.Value;
|
||||
|
||||
if (fields.Contains(Field.DatItem_LoadFlag))
|
||||
LoadFlag = item.LoadFlag;
|
||||
|
||||
|
||||
@@ -121,7 +121,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -83,7 +83,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -137,7 +137,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -218,7 +218,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
@@ -260,7 +259,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -187,7 +187,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -103,7 +103,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -263,11 +263,6 @@ namespace SabreTools.Library.DatItems
|
||||
DatItem_Feature_Name,
|
||||
DatItem_Feature_Value,
|
||||
|
||||
DatItem_AreaName,
|
||||
DatItem_AreaSize,
|
||||
DatItem_AreaWidth,
|
||||
DatItem_AreaEndianness,
|
||||
DatItem_Value,
|
||||
DatItem_LoadFlag,
|
||||
|
||||
#endregion
|
||||
@@ -296,6 +291,13 @@ namespace SabreTools.Library.DatItems
|
||||
DatItem_Optional,
|
||||
DatItem_Inverted,
|
||||
|
||||
// Rom (SoftwareList)
|
||||
DatItem_AreaName,
|
||||
DatItem_AreaSize,
|
||||
DatItem_AreaWidth,
|
||||
DatItem_AreaEndianness,
|
||||
DatItem_Value,
|
||||
|
||||
// Disk
|
||||
DatItem_Index,
|
||||
DatItem_Writable,
|
||||
@@ -324,7 +326,6 @@ namespace SabreTools.Library.DatItems
|
||||
DatItem_Clock,
|
||||
|
||||
// Condition
|
||||
DatItem_ConditionValue,
|
||||
DatItem_Relation,
|
||||
|
||||
// Configuration.Locations
|
||||
@@ -386,9 +387,6 @@ namespace SabreTools.Library.DatItems
|
||||
DatItem_FeatureStatus,
|
||||
DatItem_FeatureOverall,
|
||||
|
||||
// Info
|
||||
DatItem_InfoValue,
|
||||
|
||||
// Inputs
|
||||
DatItem_Service,
|
||||
DatItem_Tilt,
|
||||
@@ -420,9 +418,6 @@ namespace SabreTools.Library.DatItems
|
||||
// Release
|
||||
DatItem_Language,
|
||||
|
||||
// SharedFeature
|
||||
DatItem_SharedFeatureValue,
|
||||
|
||||
// Slot.SlotOptions
|
||||
DatItem_SlotOptions,
|
||||
DatItem_SlotOption_Name,
|
||||
|
||||
@@ -83,7 +83,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -93,7 +93,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Information value
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public string InfoValue { get; set; }
|
||||
public string Value { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -53,8 +53,8 @@ namespace SabreTools.Library.DatItems
|
||||
if (mappings.Keys.Contains(Field.DatItem_Name))
|
||||
Name = mappings[Field.DatItem_Name];
|
||||
|
||||
if (mappings.Keys.Contains(Field.DatItem_InfoValue))
|
||||
InfoValue = mappings[Field.DatItem_InfoValue];
|
||||
if (mappings.Keys.Contains(Field.DatItem_Value))
|
||||
Value = mappings[Field.DatItem_Value];
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -91,14 +91,13 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
InfoValue = this.InfoValue,
|
||||
Value = this.Value,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -116,7 +115,7 @@ namespace SabreTools.Library.DatItems
|
||||
Info newOther = other as Info;
|
||||
|
||||
// If the archive information matches
|
||||
return (Name == newOther.Name && InfoValue == newOther.InfoValue);
|
||||
return (Name == newOther.Name && Value == newOther.Value);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -168,9 +167,9 @@ namespace SabreTools.Library.DatItems
|
||||
return false;
|
||||
|
||||
// Filter on info value
|
||||
if (filter.DatItem_InfoValue.MatchesPositiveSet(InfoValue) == false)
|
||||
if (filter.DatItem_Value.MatchesPositiveSet(Value) == false)
|
||||
return false;
|
||||
if (filter.DatItem_InfoValue.MatchesNegativeSet(InfoValue) == true)
|
||||
if (filter.DatItem_Value.MatchesNegativeSet(Value) == true)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -189,8 +188,8 @@ namespace SabreTools.Library.DatItems
|
||||
if (fields.Contains(Field.DatItem_Name))
|
||||
Name = null;
|
||||
|
||||
if (fields.Contains(Field.DatItem_InfoValue))
|
||||
InfoValue = null;
|
||||
if (fields.Contains(Field.DatItem_Value))
|
||||
Value = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -228,8 +227,8 @@ namespace SabreTools.Library.DatItems
|
||||
if (fields.Contains(Field.DatItem_Name))
|
||||
Name = newItem.Name;
|
||||
|
||||
if (fields.Contains(Field.DatItem_InfoValue))
|
||||
InfoValue = newItem.InfoValue;
|
||||
if (fields.Contains(Field.DatItem_Value))
|
||||
Value = newItem.Value;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -105,7 +105,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -92,7 +92,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -100,7 +100,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -148,7 +148,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
@@ -182,7 +181,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -80,7 +80,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -101,7 +101,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -123,7 +123,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -185,6 +185,12 @@ namespace SabreTools.Library.DatItems
|
||||
[JsonProperty("part", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
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 // Fields
|
||||
@@ -210,6 +216,9 @@ namespace SabreTools.Library.DatItems
|
||||
base.SetFields(mappings);
|
||||
|
||||
// Handle Rom-specific fields
|
||||
|
||||
#region Common
|
||||
|
||||
if (mappings.Keys.Contains(Field.DatItem_Name))
|
||||
Name = mappings[Field.DatItem_Name];
|
||||
|
||||
@@ -266,6 +275,10 @@ namespace SabreTools.Library.DatItems
|
||||
if (mappings.Keys.Contains(Field.DatItem_Inverted))
|
||||
Inverted = mappings[Field.DatItem_Optional].AsYesNo();
|
||||
|
||||
#endregion
|
||||
|
||||
#region SoftwareList
|
||||
|
||||
if (mappings.Keys.Contains(Field.DatItem_AreaName))
|
||||
{
|
||||
if (DataArea == null)
|
||||
@@ -298,6 +311,11 @@ namespace SabreTools.Library.DatItems
|
||||
|
||||
DataArea.Endianness = mappings[Field.DatItem_AreaEndianness];
|
||||
}
|
||||
|
||||
if (mappings.Keys.Contains(Field.DatItem_Value))
|
||||
Value = mappings[Field.DatItem_Value];
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -380,7 +398,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
@@ -408,6 +425,7 @@ namespace SabreTools.Library.DatItems
|
||||
|
||||
DataArea = this.DataArea,
|
||||
Part = this.Part,
|
||||
Value = this.Value,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -754,6 +772,12 @@ namespace SabreTools.Library.DatItems
|
||||
if (filter.DatItem_Part_Interface.MatchesNegativeSet(Part?.Interface) == true)
|
||||
return false;
|
||||
|
||||
// Filter on value
|
||||
if (filter.DatItem_Value.MatchesPositiveSet(Value) == false)
|
||||
return false;
|
||||
if (filter.DatItem_Value.MatchesNegativeSet(Value) == true)
|
||||
return false;
|
||||
|
||||
#endregion
|
||||
|
||||
return true;
|
||||
@@ -862,6 +886,9 @@ namespace SabreTools.Library.DatItems
|
||||
if (fields.Contains(Field.DatItem_Features) && Part != null)
|
||||
Part.Features = null;
|
||||
|
||||
if (fields.Contains(Field.DatItem_Value))
|
||||
Value = null;
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Setting value
|
||||
/// </summary>
|
||||
[JsonProperty("value", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string SettingValue { get; set; }
|
||||
public string Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Determines if the setting is default or not
|
||||
@@ -66,7 +66,7 @@ namespace SabreTools.Library.DatItems
|
||||
Name = mappings[Field.DatItem_Setting_Name];
|
||||
|
||||
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))
|
||||
Default = mappings[Field.DatItem_Setting_Default].AsYesNo();
|
||||
@@ -115,14 +115,13 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
SettingValue = this.SettingValue,
|
||||
Value = this.Value,
|
||||
Default = this.Default,
|
||||
Conditions = this.Conditions,
|
||||
};
|
||||
@@ -143,7 +142,7 @@ namespace SabreTools.Library.DatItems
|
||||
|
||||
// If the Setting information matches
|
||||
bool match = (Name == newOther.Name
|
||||
&& SettingValue == newOther.SettingValue
|
||||
&& Value == newOther.Value
|
||||
&& Default == newOther.Default);
|
||||
if (!match)
|
||||
return match;
|
||||
@@ -209,9 +208,9 @@ namespace SabreTools.Library.DatItems
|
||||
return false;
|
||||
|
||||
// Filter on value
|
||||
if (filter.DatItem_Setting_Value.MatchesPositiveSet(SettingValue) == false)
|
||||
if (filter.DatItem_Setting_Value.MatchesPositiveSet(Value) == false)
|
||||
return false;
|
||||
if (filter.DatItem_Setting_Value.MatchesNegativeSet(SettingValue) == true)
|
||||
if (filter.DatItem_Setting_Value.MatchesNegativeSet(Value) == true)
|
||||
return false;
|
||||
|
||||
// Filter on default
|
||||
@@ -249,7 +248,7 @@ namespace SabreTools.Library.DatItems
|
||||
Name = null;
|
||||
|
||||
if (fields.Contains(Field.DatItem_Setting_Value))
|
||||
SettingValue = null;
|
||||
Value = null;
|
||||
|
||||
if (fields.Contains(Field.DatItem_Setting_Default))
|
||||
Default = null;
|
||||
@@ -302,7 +301,7 @@ namespace SabreTools.Library.DatItems
|
||||
Name = newItem.Name;
|
||||
|
||||
if (fields.Contains(Field.DatItem_Setting_Value))
|
||||
SettingValue = newItem.SettingValue;
|
||||
Value = newItem.Value;
|
||||
|
||||
if (fields.Contains(Field.DatItem_Setting_Default))
|
||||
Default = newItem.Default;
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// SharedFeature value
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public string SharedFeatureValue { get; set; }
|
||||
public string Value { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -53,8 +53,8 @@ namespace SabreTools.Library.DatItems
|
||||
if (mappings.Keys.Contains(Field.DatItem_Name))
|
||||
Name = mappings[Field.DatItem_Name];
|
||||
|
||||
if (mappings.Keys.Contains(Field.DatItem_SharedFeatureValue))
|
||||
SharedFeatureValue = mappings[Field.DatItem_SharedFeatureValue];
|
||||
if (mappings.Keys.Contains(Field.DatItem_Value))
|
||||
Value = mappings[Field.DatItem_Value];
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -91,14 +91,13 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
SharedFeatureValue = this.SharedFeatureValue,
|
||||
Value = this.Value,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -116,7 +115,7 @@ namespace SabreTools.Library.DatItems
|
||||
SharedFeature newOther = other as SharedFeature;
|
||||
|
||||
// If the archive information matches
|
||||
return (Name == newOther.Name && SharedFeatureValue == newOther.SharedFeatureValue);
|
||||
return (Name == newOther.Name && Value == newOther.Value);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -168,9 +167,9 @@ namespace SabreTools.Library.DatItems
|
||||
return false;
|
||||
|
||||
// Filter on info value
|
||||
if (filter.DatItem_SharedFeatureValue.MatchesPositiveSet(SharedFeatureValue) == false)
|
||||
if (filter.DatItem_Value.MatchesPositiveSet(Value) == false)
|
||||
return false;
|
||||
if (filter.DatItem_SharedFeatureValue.MatchesNegativeSet(SharedFeatureValue) == true)
|
||||
if (filter.DatItem_Value.MatchesNegativeSet(Value) == true)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -189,8 +188,8 @@ namespace SabreTools.Library.DatItems
|
||||
if (fields.Contains(Field.DatItem_Name))
|
||||
Name = null;
|
||||
|
||||
if (fields.Contains(Field.DatItem_SharedFeatureValue))
|
||||
SharedFeatureValue = null;
|
||||
if (fields.Contains(Field.DatItem_Value))
|
||||
Value = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -228,8 +227,8 @@ namespace SabreTools.Library.DatItems
|
||||
if (fields.Contains(Field.DatItem_Name))
|
||||
Name = newItem.Name;
|
||||
|
||||
if (fields.Contains(Field.DatItem_SharedFeatureValue))
|
||||
SharedFeatureValue = newItem.SharedFeatureValue;
|
||||
if (fields.Contains(Field.DatItem_Value))
|
||||
Value = newItem.Value;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -91,7 +91,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -100,7 +100,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -103,7 +103,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -70,7 +70,6 @@ namespace SabreTools.Library.DatItems
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Value = this.Value,
|
||||
LoadFlag = this.LoadFlag,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
|
||||
@@ -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_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>();
|
||||
|
||||
#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_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
|
||||
public FilterItem<string> DatItem_Index { get; private set; } = new FilterItem<string>();
|
||||
public FilterItem<bool?> DatItem_Writable { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||
@@ -190,7 +192,6 @@ namespace SabreTools.Library.Filtering
|
||||
|
||||
// Condition
|
||||
public FilterItem<string> DatItem_Relation { get; private set; } = new FilterItem<string>();
|
||||
public FilterItem<string> DatItem_ConditionValue { get; private set; } = new FilterItem<string>();
|
||||
|
||||
// Configuration.Locations
|
||||
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_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
|
||||
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 };
|
||||
@@ -285,9 +283,6 @@ namespace SabreTools.Library.Filtering
|
||||
// Release
|
||||
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
|
||||
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>();
|
||||
@@ -1140,13 +1135,6 @@ namespace SabreTools.Library.Filtering
|
||||
DatItem_Relation.PositiveSet.Add(value);
|
||||
break;
|
||||
|
||||
case Field.DatItem_ConditionValue:
|
||||
if (negate)
|
||||
DatItem_ConditionValue.NegativeSet.Add(value);
|
||||
else
|
||||
DatItem_ConditionValue.PositiveSet.Add(value);
|
||||
break;
|
||||
|
||||
// Configurations.Locations
|
||||
case Field.DatItem_Locations:
|
||||
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
||||
@@ -1443,14 +1431,6 @@ namespace SabreTools.Library.Filtering
|
||||
DatItem_FeatureOverall.Positive |= value.AsFeatureStatus();
|
||||
break;
|
||||
|
||||
// Info
|
||||
case Field.DatItem_InfoValue:
|
||||
if (negate)
|
||||
DatItem_InfoValue.NegativeSet.Add(value);
|
||||
else
|
||||
DatItem_InfoValue.PositiveSet.Add(value);
|
||||
break;
|
||||
|
||||
// Input
|
||||
case Field.DatItem_Service:
|
||||
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
||||
@@ -1603,14 +1583,6 @@ namespace SabreTools.Library.Filtering
|
||||
DatItem_Language.PositiveSet.Add(value);
|
||||
break;
|
||||
|
||||
// SharedFeature
|
||||
case Field.DatItem_SharedFeatureValue:
|
||||
if (negate)
|
||||
DatItem_SharedFeatureValue.NegativeSet.Add(value);
|
||||
else
|
||||
DatItem_SharedFeatureValue.PositiveSet.Add(value);
|
||||
break;
|
||||
|
||||
// Slots.SlotOptions
|
||||
case Field.DatItem_SlotOptions:
|
||||
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
@@ -734,25 +734,6 @@ namespace SabreTools.Library.Tools
|
||||
case "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 "load_flag":
|
||||
return Field.DatItem_LoadFlag;
|
||||
@@ -839,6 +820,26 @@ namespace SabreTools.Library.Tools
|
||||
case "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
|
||||
case "index":
|
||||
return Field.DatItem_Index;
|
||||
@@ -894,9 +895,6 @@ namespace SabreTools.Library.Tools
|
||||
case "relation":
|
||||
return Field.DatItem_Relation;
|
||||
|
||||
case "conditionvalue":
|
||||
return Field.DatItem_ConditionValue;
|
||||
|
||||
// Configuration
|
||||
case "locations":
|
||||
return Field.DatItem_Locations;
|
||||
@@ -1026,10 +1024,6 @@ namespace SabreTools.Library.Tools
|
||||
case "featureoverall":
|
||||
return Field.DatItem_FeatureOverall;
|
||||
|
||||
// Info
|
||||
case "infovalue":
|
||||
return Field.DatItem_InfoValue;
|
||||
|
||||
// Input
|
||||
case "service":
|
||||
return Field.DatItem_Service;
|
||||
@@ -1097,10 +1091,6 @@ namespace SabreTools.Library.Tools
|
||||
case "language":
|
||||
return Field.DatItem_Language;
|
||||
|
||||
// SharedFeature
|
||||
case "sharedfeaturevalue":
|
||||
return Field.DatItem_SharedFeatureValue;
|
||||
|
||||
// Slot
|
||||
case "slotoptions":
|
||||
return Field.DatItem_SlotOptions;
|
||||
|
||||
Reference in New Issue
Block a user