mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-24 15:55:05 +00:00
Get rid of Software metadata item
Apparently this was a mistake that has proliferated over a very long time. The Software item that was being modeled was actually the game/machine equivilent from SoftwareList. But because there's both an item called SoftwareList and a DAT type called SoftwareList, some wire got crossed and they were mentally combined. Undoing this allows for a more proper internal model, including a couple of extraneous keys that were included originally.
This commit is contained in:
@@ -309,7 +309,6 @@ namespace SabreTools.Data.Models.Metadata
|
||||
SharedFeat,
|
||||
Slot,
|
||||
SlotOption,
|
||||
Software,
|
||||
SoftwareList,
|
||||
Sound,
|
||||
SourceDetails,
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Data.Models.Metadata
|
||||
{
|
||||
[JsonObject("software"), XmlRoot("software")]
|
||||
public class Software : DatItem
|
||||
{
|
||||
#region Properties
|
||||
|
||||
public string? Description { get; set; }
|
||||
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <remarks>(yes|partial|no) "yes"</remarks>
|
||||
public Supported? Supported { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Keys
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string CloneOfKey = "cloneof";
|
||||
|
||||
/// <remarks>Info[]</remarks>
|
||||
[NoFilter]
|
||||
public const string InfoKey = "info";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NotesKey = "notes";
|
||||
|
||||
/// <remarks>Part[]</remarks>
|
||||
[NoFilter]
|
||||
public const string PartKey = "part";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string PublisherKey = "publisher";
|
||||
|
||||
/// <remarks>SharedFeat[]</remarks>
|
||||
[NoFilter]
|
||||
public const string SharedFeatKey = "sharedfeat";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string YearKey = "year";
|
||||
|
||||
#endregion
|
||||
|
||||
public Software() => ItemType = ItemType.Software;
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,18 @@
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Data.Models.Metadata
|
||||
{
|
||||
[JsonObject("softwarelist"), XmlRoot("softwarelist")]
|
||||
public class SoftwareList : DatItem
|
||||
public class SoftwareList : DatItem, ICloneable, IEquatable<SoftwareList>
|
||||
{
|
||||
#region Properties
|
||||
|
||||
public string? Description { get; set; }
|
||||
|
||||
public string? Filter { get; set; }
|
||||
|
||||
public string? Name { get; set; }
|
||||
|
||||
public string? Notes { get; set; }
|
||||
|
||||
/// <remarks>(original|compatible)</remarks>
|
||||
public SoftwareListStatus? Status { get; set; }
|
||||
|
||||
@@ -23,14 +20,48 @@ namespace SabreTools.Data.Models.Metadata
|
||||
|
||||
#endregion
|
||||
|
||||
#region Keys
|
||||
|
||||
/// <remarks>Software[]</remarks>
|
||||
[NoFilter]
|
||||
public const string SoftwareKey = "software";
|
||||
|
||||
#endregion
|
||||
|
||||
public SoftwareList() => ItemType = ItemType.SoftwareList;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public object Clone()
|
||||
{
|
||||
var obj = new SoftwareList();
|
||||
|
||||
obj.Filter = Filter;
|
||||
obj.Name = Name;
|
||||
obj.Status = Status;
|
||||
obj.Tag = Tag;
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(SoftwareList? other)
|
||||
{
|
||||
// Null never matches
|
||||
if (other is null)
|
||||
return false;
|
||||
|
||||
// Properties
|
||||
if ((Filter is null) ^ (other.Filter is null))
|
||||
return false;
|
||||
else if (Filter is not null && !Filter.Equals(other.Filter, StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
if ((Name is null) ^ (other.Name is null))
|
||||
return false;
|
||||
else if (Name is not null && !Name.Equals(other.Name, StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
if (Status != other.Status)
|
||||
return false;
|
||||
|
||||
if ((Tag is null) ^ (other.Tag is null))
|
||||
return false;
|
||||
else if (Tag is not null && !Tag.Equals(other.Tag, StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user