mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Remove nearly all explict fields
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Core.Tools;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -15,118 +13,6 @@ namespace SabreTools.DatItems.Formats
|
||||
[JsonObject("driver"), XmlRoot("driver")]
|
||||
public class Driver : DatItem
|
||||
{
|
||||
#region Fields
|
||||
|
||||
/// <summary>
|
||||
/// Overall driver status
|
||||
/// </summary>
|
||||
[JsonProperty("status", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("status")]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public SupportStatus Status
|
||||
{
|
||||
get => _internal.ReadString(Models.Metadata.Driver.StatusKey).AsEnumValue<SupportStatus>();
|
||||
set => _internal[Models.Metadata.Driver.StatusKey] = value.AsStringValue<SupportStatus>();
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public bool StatusSpecified { get { return Status != SupportStatus.NULL; } }
|
||||
|
||||
/// <summary>
|
||||
/// Driver emulation status
|
||||
/// </summary>
|
||||
[JsonProperty("emulation", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("emulation")]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public SupportStatus Emulation
|
||||
{
|
||||
get => _internal.ReadString(Models.Metadata.Driver.EmulationKey).AsEnumValue<SupportStatus>();
|
||||
set => _internal[Models.Metadata.Driver.EmulationKey] = value.AsStringValue<SupportStatus>();
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public bool EmulationSpecified { get { return Emulation != SupportStatus.NULL; } }
|
||||
|
||||
/// <summary>
|
||||
/// Cocktail orientation status
|
||||
/// </summary>
|
||||
[JsonProperty("cocktail", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("cocktail")]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public SupportStatus Cocktail
|
||||
{
|
||||
get => _internal.ReadString(Models.Metadata.Driver.CocktailKey).AsEnumValue<SupportStatus>();
|
||||
set => _internal[Models.Metadata.Driver.CocktailKey] = value.AsStringValue<SupportStatus>();
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public bool CocktailSpecified { get { return Cocktail != SupportStatus.NULL; } }
|
||||
|
||||
/// <summary>
|
||||
/// Save state support status
|
||||
/// </summary>
|
||||
[JsonProperty("savestate", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("savestate")]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public Supported SaveState
|
||||
{
|
||||
get => _internal.ReadString(Models.Metadata.Driver.SaveStateKey).AsEnumValue<Supported>();
|
||||
set => _internal[Models.Metadata.Driver.SaveStateKey] = value.AsStringValue<Supported>(useSecond: true);
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public bool SaveStateSpecified { get { return SaveState != Supported.NULL; } }
|
||||
|
||||
/// <summary>
|
||||
/// Requires artwork
|
||||
/// </summary>
|
||||
[JsonProperty("requiresartwork", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("requiresartwork")]
|
||||
public bool? RequiresArtwork
|
||||
{
|
||||
get => _internal.ReadBool(Models.Metadata.Driver.RequiresArtworkKey);
|
||||
set => _internal[Models.Metadata.Driver.RequiresArtworkKey] = value;
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public bool RequiresArtworkSpecified { get { return RequiresArtwork != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Unofficial
|
||||
/// </summary>
|
||||
[JsonProperty("unofficial", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("unofficial")]
|
||||
public bool? Unofficial
|
||||
{
|
||||
get => _internal.ReadBool(Models.Metadata.Driver.UnofficialKey);
|
||||
set => _internal[Models.Metadata.Driver.UnofficialKey] = value;
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public bool UnofficialSpecified { get { return Unofficial != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// No sound hardware
|
||||
/// </summary>
|
||||
[JsonProperty("nosoundhardware", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("nosoundhardware")]
|
||||
public bool? NoSoundHardware
|
||||
{
|
||||
get => _internal.ReadBool(Models.Metadata.Driver.NoSoundHardwareKey);
|
||||
set => _internal[Models.Metadata.Driver.NoSoundHardwareKey] = value;
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public bool NoSoundHardwareSpecified { get { return NoSoundHardware != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Incomplete
|
||||
/// </summary>
|
||||
[JsonProperty("incomplete", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("incomplete")]
|
||||
public bool? Incomplete
|
||||
{
|
||||
get => _internal.ReadBool(Models.Metadata.Driver.IncompleteKey);
|
||||
set => _internal[Models.Metadata.Driver.IncompleteKey] = value;
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public bool IncompleteSpecified { get { return Incomplete != null; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user