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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user