2017-01-27 16:42:24 -08:00
|
|
|
|
using System;
|
2020-09-07 14:47:27 -07:00
|
|
|
|
using System.Xml.Serialization;
|
2020-08-21 17:27:11 -07:00
|
|
|
|
using Newtonsoft.Json;
|
2020-08-24 13:53:53 -07:00
|
|
|
|
using Newtonsoft.Json.Converters;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
using SabreTools.Core;
|
|
|
|
|
|
using SabreTools.Core.Tools;
|
2024-03-05 01:42:42 -05:00
|
|
|
|
using SabreTools.Filter;
|
2017-01-08 22:48:19 -08:00
|
|
|
|
|
2020-12-08 15:15:41 -08:00
|
|
|
|
namespace SabreTools.DatItems
|
2016-10-24 12:58:57 -07:00
|
|
|
|
{
|
2019-01-08 12:11:55 -08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Represents the information specific to a set/game/machine
|
|
|
|
|
|
/// </summary>
|
2020-09-08 10:12:41 -07:00
|
|
|
|
[JsonObject("machine"), XmlRoot("machine")]
|
2019-01-08 12:11:55 -08:00
|
|
|
|
public class Machine : ICloneable
|
|
|
|
|
|
{
|
2020-08-20 13:17:14 -07:00
|
|
|
|
#region Fields
|
2019-01-08 12:11:55 -08:00
|
|
|
|
|
2020-09-07 22:00:02 -07:00
|
|
|
|
#region Common
|
2020-08-20 14:36:36 -07:00
|
|
|
|
|
2019-01-08 12:11:55 -08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Name of the machine
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("name", DefaultValueHandling = DefaultValueHandling.Include)]
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[XmlElement("name")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? Name
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.NameKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.NameKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2019-01-08 12:11:55 -08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Additional notes
|
|
|
|
|
|
/// </summary>
|
2020-08-20 15:39:32 -07:00
|
|
|
|
/// <remarks>Known as "Extra" in AttractMode</remarks>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("comment", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("comment")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? Comment
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.CommentKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.CommentKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2019-01-08 12:11:55 -08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Extended description
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("description", DefaultValueHandling = DefaultValueHandling.Include)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("description")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? Description
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.DescriptionKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.DescriptionKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2019-01-08 12:11:55 -08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Year(s) of release/manufacture
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("year", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("year")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? Year
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.YearKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.YearKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2019-01-08 12:11:55 -08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Manufacturer, if available
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("manufacturer", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("manufacturer")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? Manufacturer
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.ManufacturerKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.ManufacturerKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2019-01-08 12:11:55 -08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Publisher, if available
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("publisher", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("publisher")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? Publisher
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.PublisherKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.PublisherKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2019-01-08 12:11:55 -08:00
|
|
|
|
|
2020-07-18 21:35:17 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Category, if available
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("category", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("category")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? Category
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.CategoryKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.CategoryKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2020-07-18 21:35:17 -07:00
|
|
|
|
|
2019-01-08 12:11:55 -08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// fomof parent
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("romof", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[XmlElement("romof")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? RomOf
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.RomOfKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.RomOfKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2019-01-08 12:11:55 -08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// cloneof parent
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("cloneof", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[XmlElement("cloneof")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? CloneOf
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.CloneOfKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.CloneOfKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2019-01-08 12:11:55 -08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// sampleof parent
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("sampleof", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[XmlElement("sampleof")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? SampleOf
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.SampleOfKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.SampleOfKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2020-08-20 14:36:36 -07:00
|
|
|
|
|
2020-08-20 15:39:32 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Type of the machine
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("type", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-08-24 13:53:53 -07:00
|
|
|
|
[JsonConverter(typeof(StringEnumConverter))]
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[XmlElement("type")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public MachineType MachineType
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
bool? isBios = _machine.ReadBool(Models.Metadata.Machine.IsBiosKey);
|
|
|
|
|
|
bool? isDevice = _machine.ReadBool(Models.Metadata.Machine.IsDeviceKey);
|
|
|
|
|
|
bool? isMechanical = _machine.ReadBool(Models.Metadata.Machine.IsMechanicalKey);
|
2023-08-14 15:12:26 -04:00
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
{
|
2024-02-28 22:07:00 -05:00
|
|
|
|
#if NETFRAMEWORK
|
|
|
|
|
|
if ((value & MachineType.Bios) != 0)
|
|
|
|
|
|
_machine[Models.Metadata.Machine.IsBiosKey] = "yes";
|
|
|
|
|
|
if ((value & MachineType.Device) != 0)
|
|
|
|
|
|
_machine[Models.Metadata.Machine.IsDeviceKey] = "yes";
|
|
|
|
|
|
if ((value & MachineType.Mechanical) != 0)
|
|
|
|
|
|
_machine[Models.Metadata.Machine.IsMechanicalKey] = "yes";
|
|
|
|
|
|
#else
|
2023-08-14 15:12:26 -04:00
|
|
|
|
if (value.HasFlag(MachineType.Bios))
|
2023-09-04 23:51:37 -04:00
|
|
|
|
_machine[Models.Metadata.Machine.IsBiosKey] = "yes";
|
2023-08-14 15:12:26 -04:00
|
|
|
|
if (value.HasFlag(MachineType.Device))
|
2023-09-04 23:51:37 -04:00
|
|
|
|
_machine[Models.Metadata.Machine.IsDeviceKey] = "yes";
|
2023-08-14 15:12:26 -04:00
|
|
|
|
if (value.HasFlag(MachineType.Mechanical))
|
2023-09-04 23:51:37 -04:00
|
|
|
|
_machine[Models.Metadata.Machine.IsMechanicalKey] = "yes";
|
2024-02-28 22:07:00 -05:00
|
|
|
|
#endif
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-08-20 15:39:32 -07:00
|
|
|
|
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[JsonIgnore]
|
2023-04-20 10:34:37 -04:00
|
|
|
|
public bool MachineTypeSpecified { get { return MachineType != 0x0 && MachineType != MachineType.None; } }
|
2020-09-07 22:00:02 -07:00
|
|
|
|
|
2020-08-20 14:36:36 -07:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
2020-09-07 22:00:02 -07:00
|
|
|
|
#region AttractMode
|
2020-08-20 14:36:36 -07:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Player count
|
|
|
|
|
|
/// </summary>
|
2020-08-20 22:42:04 -07:00
|
|
|
|
/// <remarks>Also in Logiqx EmuArc</remarks>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("players", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("players")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? Players
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.PlayersKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.PlayersKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2020-08-20 14:36:36 -07:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Screen rotation
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("rotation", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("rotation")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? Rotation
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.RotationKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.RotationKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2020-08-20 14:36:36 -07:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Control method
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("control", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("control")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? Control
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.ControlKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.ControlKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2019-01-08 12:11:55 -08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Support status
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("status", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("status")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? Status
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.StatusKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.StatusKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2019-01-08 12:11:55 -08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2020-08-20 14:36:36 -07:00
|
|
|
|
/// Display count
|
2019-01-08 12:11:55 -08:00
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("displaycount", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("displaycount")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? DisplayCount
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.DisplayCountKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.DisplayCountKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2019-01-08 12:11:55 -08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2020-08-20 14:36:36 -07:00
|
|
|
|
/// Display type
|
2019-01-08 12:11:55 -08:00
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("displaytype", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("displaytype")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? DisplayType
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.DisplayTypeKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.DisplayTypeKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2019-01-08 12:11:55 -08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2020-08-20 14:36:36 -07:00
|
|
|
|
/// Number of input buttons
|
2019-01-08 12:11:55 -08:00
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("buttons", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("buttons")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? Buttons
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.ButtonsKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.ButtonsKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2020-08-20 14:36:36 -07:00
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
2020-09-07 22:00:02 -07:00
|
|
|
|
#region ListXML
|
2019-01-08 12:11:55 -08:00
|
|
|
|
|
2020-12-28 10:22:40 -08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// History.dat entry for the machine
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("history", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
|
|
|
|
[XmlElement("history")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? History
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.HistoryKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.HistoryKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2020-12-28 10:22:40 -08:00
|
|
|
|
|
2019-01-08 12:11:55 -08:00
|
|
|
|
/// <summary>
|
2020-08-20 14:36:36 -07:00
|
|
|
|
/// Emulator source file related to the machine
|
2019-01-08 12:11:55 -08:00
|
|
|
|
/// </summary>
|
2020-08-20 15:39:32 -07:00
|
|
|
|
/// <remarks>Also in Logiqx</remarks>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("sourcefile", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[XmlElement("sourcefile")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? SourceFile
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.SourceFileKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.SourceFileKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2020-08-20 14:36:36 -07:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Machine runnable status
|
|
|
|
|
|
/// </summary>
|
2020-08-20 15:39:32 -07:00
|
|
|
|
/// <remarks>Also in Logiqx</remarks>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("runnable", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[XmlElement("runnable")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public Runnable Runnable
|
|
|
|
|
|
{
|
2024-03-05 15:24:11 -05:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.RunnableKey).AsEnumValue<Runnable>();
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.RunnableKey] = value.AsStringValue<Runnable>();
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2019-01-08 12:11:55 -08:00
|
|
|
|
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
public bool RunnableSpecified { get { return Runnable != Runnable.NULL; } }
|
|
|
|
|
|
|
2020-08-20 14:36:36 -07:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
2020-09-07 22:00:02 -07:00
|
|
|
|
#region Logiqx
|
2020-08-20 14:36:36 -07:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Machine board name
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("board", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[XmlElement("board")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? Board
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.BoardKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.BoardKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2020-08-20 14:36:36 -07:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Rebuild location if different than machine name
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("rebuildto", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[XmlElement("rebuildto")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? RebuildTo
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.RebuildToKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.RebuildToKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2020-08-20 14:36:36 -07:00
|
|
|
|
|
2023-03-26 21:47:17 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// No-Intro ID for the game
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("nointroid", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
|
|
|
|
[XmlElement("nointroid")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? NoIntroId
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.IdKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.IdKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2023-03-26 21:47:17 -04:00
|
|
|
|
|
2023-04-03 11:57:06 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// No-Intro ID for the game
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("nointrocloneofid", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
|
|
|
|
[XmlElement("nointrocloneofid")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? NoIntroCloneOfId
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.CloneOfIdKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.CloneOfIdKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2023-04-03 11:57:06 -04:00
|
|
|
|
|
2020-08-20 14:36:36 -07:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
2020-08-24 22:25:47 -07:00
|
|
|
|
// TODO: Should this be a separate object for TruRip?
|
2020-09-07 22:00:02 -07:00
|
|
|
|
#region Logiqx EmuArc
|
2020-08-20 22:42:04 -07:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Title ID
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("titleid", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("titleid")]
|
2023-08-14 13:17:51 -04:00
|
|
|
|
public string? TitleID { get; set; } = null;
|
2020-08-20 22:42:04 -07:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Machine developer
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("developer", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("developer")]
|
2023-08-14 13:17:51 -04:00
|
|
|
|
public string? Developer { get; set; } = null;
|
2020-08-20 22:42:04 -07:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Game genre
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("genre", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("genre")]
|
2023-08-14 13:17:51 -04:00
|
|
|
|
public string? Genre { get; set; } = null;
|
2020-08-20 22:42:04 -07:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Game subgenre
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("subgenre", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("subgenre")]
|
2023-08-14 13:17:51 -04:00
|
|
|
|
public string? Subgenre { get; set; } = null;
|
2020-08-20 22:42:04 -07:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Game ratings
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("ratings", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("ratings")]
|
2023-08-14 13:17:51 -04:00
|
|
|
|
public string? Ratings { get; set; } = null;
|
2020-08-20 22:42:04 -07:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Game score
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("score", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("score")]
|
2023-08-14 13:17:51 -04:00
|
|
|
|
public string? Score { get; set; } = null;
|
2020-08-20 22:42:04 -07:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Is the machine enabled
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("enabled", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("enabled")]
|
2023-08-14 13:17:51 -04:00
|
|
|
|
public string? Enabled { get; set; } = null; // bool?
|
2020-08-20 22:42:04 -07:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Does the game have a CRC check
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("hascrc", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("hascrc")]
|
2020-08-25 22:13:49 -07:00
|
|
|
|
public bool? Crc { get; set; } = null;
|
2020-08-20 22:42:04 -07:00
|
|
|
|
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
public bool CrcSpecified { get { return Crc != null; } }
|
|
|
|
|
|
|
2020-08-20 22:42:04 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Machine relations
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("relatedto", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("relatedto")]
|
2023-08-14 13:17:51 -04:00
|
|
|
|
public string? RelatedTo { get; set; } = null;
|
2020-08-20 22:42:04 -07:00
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
2020-09-07 22:00:02 -07:00
|
|
|
|
#region OpenMSX
|
2020-08-21 17:27:11 -07:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Generation MSX ID
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("genmsxid", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("genmsxid")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? GenMSXID
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.GenMSXIDKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.GenMSXIDKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2020-08-21 17:27:11 -07:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// MSX System
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("system", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("system")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? System
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.SystemKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.SystemKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2020-08-21 17:27:11 -07:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Machine country of origin
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("country", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("country")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public string? Country
|
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.CountryKey);
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.CountryKey] = value;
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2020-08-21 17:27:11 -07:00
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
2020-09-07 22:00:02 -07:00
|
|
|
|
#region SoftwareList
|
2020-08-20 14:36:36 -07:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Support status
|
|
|
|
|
|
/// </summary>
|
2020-08-24 11:56:49 -07:00
|
|
|
|
[JsonProperty("supported", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[XmlElement("supported")]
|
2023-08-14 15:12:26 -04:00
|
|
|
|
public Supported Supported
|
|
|
|
|
|
{
|
2024-03-05 15:24:11 -05:00
|
|
|
|
get => _machine.ReadString(Models.Metadata.Machine.SupportedKey).AsEnumValue<Supported>();
|
|
|
|
|
|
set => _machine[Models.Metadata.Machine.SupportedKey] = value.AsStringValue<Supported>(useSecond: true);
|
2023-08-14 15:12:26 -04:00
|
|
|
|
}
|
2020-08-20 14:36:36 -07:00
|
|
|
|
|
2020-09-07 14:47:27 -07:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
public bool SupportedSpecified { get { return Supported != Supported.NULL; } }
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
2023-08-14 15:12:26 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Internal Machine model
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonIgnore]
|
2024-02-28 19:19:50 -05:00
|
|
|
|
private Models.Metadata.Machine _machine = [];
|
2023-08-14 15:12:26 -04:00
|
|
|
|
|
2020-09-07 22:00:02 -07:00
|
|
|
|
#endregion // Fields
|
2019-01-08 12:11:55 -08:00
|
|
|
|
|
|
|
|
|
|
#region Constructors
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Create a new Machine object
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public Machine()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Create a new Machine object with the included information
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="name">Name of the machine</param>
|
|
|
|
|
|
/// <param name="description">Description of the machine</param>
|
|
|
|
|
|
public Machine(string name, string description)
|
|
|
|
|
|
{
|
|
|
|
|
|
Name = name;
|
|
|
|
|
|
Description = description;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Cloning methods
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Create a clone of the current machine
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>New machine with the same values as the current one</returns>
|
|
|
|
|
|
public object Clone()
|
|
|
|
|
|
{
|
|
|
|
|
|
return new Machine()
|
|
|
|
|
|
{
|
2020-08-20 16:49:21 -07:00
|
|
|
|
#region Common
|
|
|
|
|
|
|
2024-02-28 19:19:50 -05:00
|
|
|
|
_machine = this._machine.Clone() as Models.Metadata.Machine ?? [],
|
2020-08-20 14:36:36 -07:00
|
|
|
|
|
2020-08-20 16:49:21 -07:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
2020-08-20 22:42:04 -07:00
|
|
|
|
#region Logiqx EmuArc
|
|
|
|
|
|
|
|
|
|
|
|
TitleID = this.TitleID,
|
|
|
|
|
|
Developer = this.Developer,
|
|
|
|
|
|
Genre = this.Genre,
|
|
|
|
|
|
Subgenre = this.Subgenre,
|
|
|
|
|
|
Ratings = this.Ratings,
|
|
|
|
|
|
Score = this.Score,
|
|
|
|
|
|
Enabled = this.Enabled,
|
2020-08-25 22:13:49 -07:00
|
|
|
|
Crc = this.Crc,
|
2020-08-20 22:42:04 -07:00
|
|
|
|
RelatedTo = this.RelatedTo,
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
2019-01-08 12:11:55 -08:00
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
2024-03-05 01:42:42 -05:00
|
|
|
|
|
|
|
|
|
|
#region Manipulation
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-03-05 02:56:50 -05:00
|
|
|
|
/// Runs a filter and determines if it passes or not
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="filterRunner">Filter runner to use for checking</param>
|
|
|
|
|
|
/// <returns>True if the Machine passes the filter, false otherwise</returns>
|
|
|
|
|
|
public bool PassesFilter(FilterRunner filterRunner) => filterRunner.Run(_machine);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-03-05 01:42:42 -05:00
|
|
|
|
/// Remove a field from the Machine
|
|
|
|
|
|
/// </summary>
|
2024-03-05 16:37:52 -05:00
|
|
|
|
/// <param name="fieldName">Field to remove</param>
|
2024-03-05 01:42:42 -05:00
|
|
|
|
/// <returns>True if the removal was successful, false otherwise</returns>
|
2024-03-05 16:37:52 -05:00
|
|
|
|
public bool RemoveField(string? fieldName)
|
|
|
|
|
|
=> FieldManipulator.RemoveField(_machine, fieldName);
|
2024-03-05 01:42:42 -05:00
|
|
|
|
|
2024-03-05 02:20:12 -05:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Set a field in the Machine from a mapping string
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="machineField">Machine field to set</param>
|
|
|
|
|
|
/// <param name="value">String representing the value to set</param>
|
|
|
|
|
|
/// <returns>True if the setting was successful, false otherwise</returns>
|
|
|
|
|
|
/// <remarks>This only performs minimal validation before setting</remarks>
|
|
|
|
|
|
public bool SetField(MachineField machineField, string value)
|
|
|
|
|
|
{
|
|
|
|
|
|
// Get the correct internal field name
|
|
|
|
|
|
string? fieldName = machineField switch
|
|
|
|
|
|
{
|
|
|
|
|
|
MachineField.Board => Models.Metadata.Machine.BoardKey,
|
|
|
|
|
|
MachineField.Buttons => Models.Metadata.Machine.ButtonsKey,
|
|
|
|
|
|
MachineField.Category => Models.Metadata.Machine.CategoryKey,
|
|
|
|
|
|
MachineField.CloneOf => Models.Metadata.Machine.CloneOfKey,
|
|
|
|
|
|
MachineField.CloneOfID => Models.Metadata.Machine.CloneOfIdKey,
|
|
|
|
|
|
MachineField.Comment => Models.Metadata.Machine.CommentKey,
|
|
|
|
|
|
MachineField.Control => Models.Metadata.Machine.ControlKey,
|
|
|
|
|
|
MachineField.Country => Models.Metadata.Machine.CountryKey,
|
|
|
|
|
|
//MachineField.CRC => Models.Metadata.Machine.CRCKey,
|
|
|
|
|
|
MachineField.Description => Models.Metadata.Machine.DescriptionKey,
|
|
|
|
|
|
//MachineField.Developer => Models.Metadata.Machine.DeveloperKey,
|
|
|
|
|
|
MachineField.DisplayCount => Models.Metadata.Machine.DisplayCountKey,
|
|
|
|
|
|
MachineField.DisplayType => Models.Metadata.Machine.DisplayTypeKey,
|
|
|
|
|
|
//MachineField.Enabled => Models.Metadata.Machine.EnabledKey,
|
|
|
|
|
|
MachineField.GenMSXID => Models.Metadata.Machine.GenMSXIDKey,
|
|
|
|
|
|
//MachineField.Genre => Models.Metadata.Machine.GenreKey,
|
|
|
|
|
|
MachineField.History => Models.Metadata.Machine.HistoryKey,
|
|
|
|
|
|
MachineField.ID => Models.Metadata.Machine.IdKey,
|
|
|
|
|
|
MachineField.Manufacturer => Models.Metadata.Machine.ManufacturerKey,
|
|
|
|
|
|
MachineField.Name => Models.Metadata.Machine.NameKey,
|
|
|
|
|
|
MachineField.Players => Models.Metadata.Machine.PlayersKey,
|
|
|
|
|
|
MachineField.Publisher => Models.Metadata.Machine.PublisherKey,
|
|
|
|
|
|
//MachineField.Ratings => Models.Metadata.Machine.RatingsKey,
|
|
|
|
|
|
MachineField.RebuildTo => Models.Metadata.Machine.RebuildToKey,
|
|
|
|
|
|
//MachineField.RelatedTo => Models.Metadata.Machine.RelatedToKey,
|
|
|
|
|
|
MachineField.RomOf => Models.Metadata.Machine.RomOfKey,
|
|
|
|
|
|
MachineField.Rotation => Models.Metadata.Machine.RotationKey,
|
|
|
|
|
|
MachineField.Runnable => Models.Metadata.Machine.RunnableKey,
|
|
|
|
|
|
MachineField.SampleOf => Models.Metadata.Machine.SampleOfKey,
|
|
|
|
|
|
//MachineField.Score => Models.Metadata.Machine.ScoreKey,
|
|
|
|
|
|
MachineField.SourceFile => Models.Metadata.Machine.SourceFileKey,
|
|
|
|
|
|
MachineField.Status => Models.Metadata.Machine.StatusKey,
|
|
|
|
|
|
//MachineField.Subgenre => Models.Metadata.Machine.SubgenreKey,
|
|
|
|
|
|
MachineField.Supported => Models.Metadata.Machine.SupportedKey,
|
|
|
|
|
|
MachineField.System => Models.Metadata.Machine.SystemKey,
|
|
|
|
|
|
//MachineField.TitleID => Models.Metadata.Machine.TitleIDKey,
|
|
|
|
|
|
//MachineField.Type => Models.Metadata.Machine.TypeKey,
|
|
|
|
|
|
MachineField.Year => Models.Metadata.Machine.YearKey,
|
|
|
|
|
|
_ => null,
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// A null value means special handling is needed
|
|
|
|
|
|
if (fieldName == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
switch (machineField)
|
|
|
|
|
|
{
|
|
|
|
|
|
case MachineField.CRC: Crc = value.AsYesNo(); return true;
|
|
|
|
|
|
case MachineField.Developer: Developer = value; return true;
|
|
|
|
|
|
case MachineField.Enabled: Enabled = value; return true;
|
|
|
|
|
|
case MachineField.Genre: Genre = value; return true;
|
|
|
|
|
|
case MachineField.Ratings: Ratings = value; return true;
|
|
|
|
|
|
case MachineField.RelatedTo: RelatedTo = value; return true;
|
|
|
|
|
|
case MachineField.Score: Score = value; return true;
|
|
|
|
|
|
case MachineField.Subgenre: Subgenre = value; return true;
|
|
|
|
|
|
case MachineField.TitleID: TitleID = value; return true;
|
2024-03-05 15:24:11 -05:00
|
|
|
|
case MachineField.Type: MachineType = value.AsEnumValue<MachineType>(); return true;
|
2024-03-05 02:20:12 -05:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Remove the field and return
|
|
|
|
|
|
return FieldManipulator.SetField(_machine, fieldName, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-03-05 01:42:42 -05:00
|
|
|
|
#endregion
|
2019-01-08 12:11:55 -08:00
|
|
|
|
}
|
2016-10-24 12:58:57 -07:00
|
|
|
|
}
|