Update formatting of DatItems

This commit is contained in:
Matt Nadareski
2022-11-03 12:22:17 -07:00
parent 7e3c04e8a2
commit ee356fb8a2
38 changed files with 305 additions and 424 deletions

View File

@@ -1,8 +1,7 @@
using System.Collections.Generic;
using System.Xml.Serialization;
using SabreTools.Core;
using Newtonsoft.Json;
using SabreTools.Core;
namespace SabreTools.DatItems.Formats
{
@@ -17,15 +16,13 @@ namespace SabreTools.DatItems.Formats
/// <summary>
/// Name of the item
/// </summary>
[JsonProperty("name")]
[XmlElement("name")]
[JsonProperty("name"), XmlElement("name")]
public string Name { get; set; }
/// <summary>
/// Determine whether the value is default
/// </summary>
[JsonProperty("default", DefaultValueHandling = DefaultValueHandling.Ignore)]
[XmlElement("default")]
[JsonProperty("default", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("default")]
public bool? Default { get; set; }
[JsonIgnore]
@@ -34,8 +31,7 @@ namespace SabreTools.DatItems.Formats
/// <summary>
/// Conditions associated with the adjustment
/// </summary>
[JsonProperty("conditions", DefaultValueHandling = DefaultValueHandling.Ignore)]
[XmlElement("conditions")]
[JsonProperty("conditions", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("conditions")]
public List<Condition> Conditions { get; set; }
[JsonIgnore]
@@ -68,6 +64,7 @@ namespace SabreTools.DatItems.Formats
#region Cloning Methods
/// <inheritdoc/>
public override object Clone()
{
return new Adjuster()
@@ -89,6 +86,7 @@ namespace SabreTools.DatItems.Formats
#region Comparision Methods
/// <inheritdoc/>
public override bool Equals(DatItem other)
{
// If we don't have a Adjuster, return false
@@ -99,7 +97,8 @@ namespace SabreTools.DatItems.Formats
Adjuster newOther = other as Adjuster;
// If the Adjuster information matches
bool match = (Name == newOther.Name && Default == newOther.Default);
bool match = (Name == newOther.Name
&& Default == newOther.Default);
if (!match)
return match;