mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Use internal models for Machine
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
using SabreTools.Core;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Converters;
|
using Newtonsoft.Json.Converters;
|
||||||
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Core.Tools;
|
||||||
|
|
||||||
namespace SabreTools.DatItems
|
namespace SabreTools.DatItems
|
||||||
{
|
{
|
||||||
@@ -22,7 +22,11 @@ namespace SabreTools.DatItems
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("name", DefaultValueHandling = DefaultValueHandling.Include)]
|
[JsonProperty("name", DefaultValueHandling = DefaultValueHandling.Include)]
|
||||||
[XmlElement("name")]
|
[XmlElement("name")]
|
||||||
public string? Name { get; set; } = null;
|
public string? Name
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.NameKey);
|
||||||
|
set => _machine[Models.Internal.Machine.NameKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Additional notes
|
/// Additional notes
|
||||||
@@ -30,63 +34,99 @@ namespace SabreTools.DatItems
|
|||||||
/// <remarks>Known as "Extra" in AttractMode</remarks>
|
/// <remarks>Known as "Extra" in AttractMode</remarks>
|
||||||
[JsonProperty("comment", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("comment", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("comment")]
|
[XmlElement("comment")]
|
||||||
public string? Comment { get; set; } = null;
|
public string? Comment
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.CommentKey);
|
||||||
|
set => _machine[Models.Internal.Machine.CommentKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Extended description
|
/// Extended description
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("description", DefaultValueHandling = DefaultValueHandling.Include)]
|
[JsonProperty("description", DefaultValueHandling = DefaultValueHandling.Include)]
|
||||||
[XmlElement("description")]
|
[XmlElement("description")]
|
||||||
public string? Description { get; set; } = null;
|
public string? Description
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.DescriptionKey);
|
||||||
|
set => _machine[Models.Internal.Machine.DescriptionKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Year(s) of release/manufacture
|
/// Year(s) of release/manufacture
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("year", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("year", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("year")]
|
[XmlElement("year")]
|
||||||
public string? Year { get; set; } = null;
|
public string? Year
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.YearKey);
|
||||||
|
set => _machine[Models.Internal.Machine.YearKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Manufacturer, if available
|
/// Manufacturer, if available
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("manufacturer", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("manufacturer", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("manufacturer")]
|
[XmlElement("manufacturer")]
|
||||||
public string? Manufacturer { get; set; } = null;
|
public string? Manufacturer
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.ManufacturerKey);
|
||||||
|
set => _machine[Models.Internal.Machine.ManufacturerKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Publisher, if available
|
/// Publisher, if available
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("publisher", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("publisher", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("publisher")]
|
[XmlElement("publisher")]
|
||||||
public string? Publisher { get; set; } = null;
|
public string? Publisher
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.PublisherKey);
|
||||||
|
set => _machine[Models.Internal.Machine.PublisherKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Category, if available
|
/// Category, if available
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("category", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("category", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("category")]
|
[XmlElement("category")]
|
||||||
public string? Category { get; set; } = null;
|
public string? Category
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.CategoryKey);
|
||||||
|
set => _machine[Models.Internal.Machine.CategoryKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// fomof parent
|
/// fomof parent
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("romof", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("romof", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("romof")]
|
[XmlElement("romof")]
|
||||||
public string? RomOf { get; set; } = null;
|
public string? RomOf
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.RomOfKey);
|
||||||
|
set => _machine[Models.Internal.Machine.RomOfKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// cloneof parent
|
/// cloneof parent
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("cloneof", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("cloneof", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("cloneof")]
|
[XmlElement("cloneof")]
|
||||||
public string? CloneOf { get; set; } = null;
|
public string? CloneOf
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.CloneOfKey);
|
||||||
|
set => _machine[Models.Internal.Machine.CloneOfKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// sampleof parent
|
/// sampleof parent
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("sampleof", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("sampleof", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("sampleof")]
|
[XmlElement("sampleof")]
|
||||||
public string? SampleOf { get; set; } = null;
|
public string? SampleOf
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.SampleOfKey);
|
||||||
|
set => _machine[Models.Internal.Machine.SampleOfKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Type of the machine
|
/// Type of the machine
|
||||||
@@ -94,7 +134,34 @@ namespace SabreTools.DatItems
|
|||||||
[JsonProperty("type", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("type", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[JsonConverter(typeof(StringEnumConverter))]
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
[XmlElement("type")]
|
[XmlElement("type")]
|
||||||
public MachineType MachineType { get; set; } = 0x0;
|
public MachineType MachineType
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
bool? isBios = _machine.ReadBool(Models.Internal.Machine.IsBiosKey);
|
||||||
|
bool? isDevice = _machine.ReadBool(Models.Internal.Machine.IsDeviceKey);
|
||||||
|
bool? isMechanical = _machine.ReadBool(Models.Internal.Machine.IsMechanicalKey);
|
||||||
|
|
||||||
|
MachineType machineType = MachineType.None;
|
||||||
|
if (isBios == true)
|
||||||
|
machineType |= MachineType.Bios;
|
||||||
|
if (isDevice == true)
|
||||||
|
machineType |= MachineType.Device;
|
||||||
|
if (isMechanical == true)
|
||||||
|
machineType |= MachineType.Mechanical;
|
||||||
|
|
||||||
|
return machineType;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value.HasFlag(MachineType.Bios))
|
||||||
|
_machine[Models.Internal.Machine.IsBiosKey] = "yes";
|
||||||
|
if (value.HasFlag(MachineType.Device))
|
||||||
|
_machine[Models.Internal.Machine.IsDeviceKey] = "yes";
|
||||||
|
if (value.HasFlag(MachineType.Mechanical))
|
||||||
|
_machine[Models.Internal.Machine.IsMechanicalKey] = "yes";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public bool MachineTypeSpecified { get { return MachineType != 0x0 && MachineType != MachineType.None; } }
|
public bool MachineTypeSpecified { get { return MachineType != 0x0 && MachineType != MachineType.None; } }
|
||||||
@@ -109,49 +176,77 @@ namespace SabreTools.DatItems
|
|||||||
/// <remarks>Also in Logiqx EmuArc</remarks>
|
/// <remarks>Also in Logiqx EmuArc</remarks>
|
||||||
[JsonProperty("players", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("players", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("players")]
|
[XmlElement("players")]
|
||||||
public string? Players { get; set; } = null;
|
public string? Players
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.PlayersKey);
|
||||||
|
set => _machine[Models.Internal.Machine.PlayersKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Screen rotation
|
/// Screen rotation
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("rotation", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("rotation", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("rotation")]
|
[XmlElement("rotation")]
|
||||||
public string? Rotation { get; set; } = null;
|
public string? Rotation
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.RotationKey);
|
||||||
|
set => _machine[Models.Internal.Machine.RotationKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Control method
|
/// Control method
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("control", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("control", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("control")]
|
[XmlElement("control")]
|
||||||
public string? Control { get; set; } = null;
|
public string? Control
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.ControlKey);
|
||||||
|
set => _machine[Models.Internal.Machine.ControlKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Support status
|
/// Support status
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("status", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("status", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("status")]
|
[XmlElement("status")]
|
||||||
public string? Status { get; set; } = null;
|
public string? Status
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.StatusKey);
|
||||||
|
set => _machine[Models.Internal.Machine.StatusKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Display count
|
/// Display count
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("displaycount", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("displaycount", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("displaycount")]
|
[XmlElement("displaycount")]
|
||||||
public string? DisplayCount { get; set; } = null;
|
public string? DisplayCount
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.DisplayCountKey);
|
||||||
|
set => _machine[Models.Internal.Machine.DisplayCountKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Display type
|
/// Display type
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("displaytype", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("displaytype", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("displaytype")]
|
[XmlElement("displaytype")]
|
||||||
public string? DisplayType { get; set; } = null;
|
public string? DisplayType
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.DisplayTypeKey);
|
||||||
|
set => _machine[Models.Internal.Machine.DisplayTypeKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of input buttons
|
/// Number of input buttons
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("buttons", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("buttons", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("buttons")]
|
[XmlElement("buttons")]
|
||||||
public string? Buttons { get; set; } = null;
|
public string? Buttons
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.ButtonsKey);
|
||||||
|
set => _machine[Models.Internal.Machine.ButtonsKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -162,7 +257,11 @@ namespace SabreTools.DatItems
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("history", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("history", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("history")]
|
[XmlElement("history")]
|
||||||
public string? History { get; set; } = null;
|
public string? History
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.HistoryKey);
|
||||||
|
set => _machine[Models.Internal.Machine.HistoryKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Emulator source file related to the machine
|
/// Emulator source file related to the machine
|
||||||
@@ -170,7 +269,11 @@ namespace SabreTools.DatItems
|
|||||||
/// <remarks>Also in Logiqx</remarks>
|
/// <remarks>Also in Logiqx</remarks>
|
||||||
[JsonProperty("sourcefile", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("sourcefile", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("sourcefile")]
|
[XmlElement("sourcefile")]
|
||||||
public string? SourceFile { get; set; } = null;
|
public string? SourceFile
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.SourceFileKey);
|
||||||
|
set => _machine[Models.Internal.Machine.SourceFileKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Machine runnable status
|
/// Machine runnable status
|
||||||
@@ -178,7 +281,11 @@ namespace SabreTools.DatItems
|
|||||||
/// <remarks>Also in Logiqx</remarks>
|
/// <remarks>Also in Logiqx</remarks>
|
||||||
[JsonProperty("runnable", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("runnable", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("runnable")]
|
[XmlElement("runnable")]
|
||||||
public Runnable Runnable { get; set; } = Runnable.NULL;
|
public Runnable Runnable
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.RunnableKey).AsRunnable();
|
||||||
|
set => _machine[Models.Internal.Machine.RunnableKey] = value.FromRunnable();
|
||||||
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public bool RunnableSpecified { get { return Runnable != Runnable.NULL; } }
|
public bool RunnableSpecified { get { return Runnable != Runnable.NULL; } }
|
||||||
@@ -192,28 +299,44 @@ namespace SabreTools.DatItems
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("board", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("board", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("board")]
|
[XmlElement("board")]
|
||||||
public string? Board { get; set; } = null;
|
public string? Board
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.BoardKey);
|
||||||
|
set => _machine[Models.Internal.Machine.BoardKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Rebuild location if different than machine name
|
/// Rebuild location if different than machine name
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("rebuildto", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("rebuildto", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("rebuildto")]
|
[XmlElement("rebuildto")]
|
||||||
public string? RebuildTo { get; set; } = null;
|
public string? RebuildTo
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.RebuildToKey);
|
||||||
|
set => _machine[Models.Internal.Machine.RebuildToKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// No-Intro ID for the game
|
/// No-Intro ID for the game
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("nointroid", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("nointroid", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("nointroid")]
|
[XmlElement("nointroid")]
|
||||||
public string? NoIntroId { get; set; } = null;
|
public string? NoIntroId
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.IdKey);
|
||||||
|
set => _machine[Models.Internal.Machine.IdKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// No-Intro ID for the game
|
/// No-Intro ID for the game
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("nointrocloneofid", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("nointrocloneofid", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("nointrocloneofid")]
|
[XmlElement("nointrocloneofid")]
|
||||||
public string? NoIntroCloneOfId { get; set; } = null;
|
public string? NoIntroCloneOfId
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.CloneOfIdKey);
|
||||||
|
set => _machine[Models.Internal.Machine.CloneOfIdKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -295,21 +418,33 @@ namespace SabreTools.DatItems
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("genmsxid", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("genmsxid", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("genmsxid")]
|
[XmlElement("genmsxid")]
|
||||||
public string? GenMSXID { get; set; } = null;
|
public string? GenMSXID
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.GenMSXIDKey);
|
||||||
|
set => _machine[Models.Internal.Machine.GenMSXIDKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// MSX System
|
/// MSX System
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("system", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("system", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("system")]
|
[XmlElement("system")]
|
||||||
public string? System { get; set; } = null;
|
public string? System
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.SystemKey);
|
||||||
|
set => _machine[Models.Internal.Machine.SystemKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Machine country of origin
|
/// Machine country of origin
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("country", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("country", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("country")]
|
[XmlElement("country")]
|
||||||
public string? Country { get; set; } = null;
|
public string? Country
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.CountryKey);
|
||||||
|
set => _machine[Models.Internal.Machine.CountryKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -320,13 +455,23 @@ namespace SabreTools.DatItems
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("supported", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("supported", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[XmlElement("supported")]
|
[XmlElement("supported")]
|
||||||
public Supported Supported { get; set; } = Supported.NULL;
|
public Supported Supported
|
||||||
|
{
|
||||||
|
get => _machine.ReadString(Models.Internal.Machine.SupportedKey).AsSupported();
|
||||||
|
set => _machine[Models.Internal.Machine.SupportedKey] = value.FromSupported(verbose: true);
|
||||||
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public bool SupportedSpecified { get { return Supported != Supported.NULL; } }
|
public bool SupportedSpecified { get { return Supported != Supported.NULL; } }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Internal Machine model
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
|
private Models.Internal.Machine _machine = new();
|
||||||
|
|
||||||
#endregion // Fields
|
#endregion // Fields
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
@@ -363,46 +508,7 @@ namespace SabreTools.DatItems
|
|||||||
{
|
{
|
||||||
#region Common
|
#region Common
|
||||||
|
|
||||||
Name = this.Name,
|
_machine = this._machine.Clone() as Models.Internal.Machine ?? new Models.Internal.Machine(),
|
||||||
Comment = this.Comment,
|
|
||||||
Description = this.Description,
|
|
||||||
Year = this.Year,
|
|
||||||
Manufacturer = this.Manufacturer,
|
|
||||||
Publisher = this.Publisher,
|
|
||||||
Category = this.Category,
|
|
||||||
RomOf = this.RomOf,
|
|
||||||
CloneOf = this.CloneOf,
|
|
||||||
SampleOf = this.SampleOf,
|
|
||||||
MachineType = this.MachineType,
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region AttractMode
|
|
||||||
|
|
||||||
Players = this.Players,
|
|
||||||
Rotation = this.Rotation,
|
|
||||||
Control = this.Control,
|
|
||||||
Status = this.Status,
|
|
||||||
DisplayCount = this.DisplayCount,
|
|
||||||
DisplayType = this.DisplayType,
|
|
||||||
Buttons = this.Buttons,
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region ListXML
|
|
||||||
|
|
||||||
History = this.History,
|
|
||||||
SourceFile = this.SourceFile,
|
|
||||||
Runnable = this.Runnable,
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Logiqx
|
|
||||||
|
|
||||||
Board = this.Board,
|
|
||||||
RebuildTo = this.RebuildTo,
|
|
||||||
NoIntroId = this.NoIntroId,
|
|
||||||
NoIntroCloneOfId = this.NoIntroCloneOfId,
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -419,20 +525,6 @@ namespace SabreTools.DatItems
|
|||||||
RelatedTo = this.RelatedTo,
|
RelatedTo = this.RelatedTo,
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region OpenMSX
|
|
||||||
|
|
||||||
GenMSXID = this.GenMSXID,
|
|
||||||
System = this.System,
|
|
||||||
Country = this.Country,
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region SoftwareList
|
|
||||||
|
|
||||||
Supported = this.Supported,
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user