mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Start creating Dictionary-based internal models
This commit is contained in:
@@ -494,6 +494,9 @@ namespace SabreTools.Core
|
||||
[Mapping("location")]
|
||||
Location,
|
||||
|
||||
[Mapping("original")]
|
||||
Original,
|
||||
|
||||
[Mapping("part")]
|
||||
Part,
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SabreTools.DatItems
|
||||
{
|
||||
/// <summary>
|
||||
/// Format-agnostic representation of item data
|
||||
/// </summary>
|
||||
public class DatItemDict : Dictionary<string, object>
|
||||
{
|
||||
#region Common Keys
|
||||
|
||||
public const string NameKey = "name";
|
||||
|
||||
#endregion
|
||||
|
||||
public string? Name
|
||||
{
|
||||
get => ContainsKey(NameKey) ? this[NameKey] as string : null;
|
||||
set => this[NameKey] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -123,12 +123,12 @@ namespace SabreTools.Models.ArchiveDotOrg
|
||||
[XmlElement("ocr_detected_script_conf")]
|
||||
public string? TesseractOCRDetectedScriptConf { get; set; }
|
||||
|
||||
[XmlElement("ocr_parameters")]
|
||||
public string? TesseractOCRParameters { get; set; }
|
||||
|
||||
[XmlElement("ocr_module_version")]
|
||||
public string? TesseractOCRModuleVersion { get; set; }
|
||||
|
||||
[XmlElement("ocr_parameters")]
|
||||
public string? TesseractOCRParameters { get; set; }
|
||||
|
||||
[XmlElement("pdf_module_version")]
|
||||
public string? PDFModuleVersion { get; set; }
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace SabreTools.Models.ClrMamePro
|
||||
/// <remarks>entry</remarks>
|
||||
public string[]? Entry { get; set; }
|
||||
|
||||
/// <remarks>default</remarks>
|
||||
/// <remarks>default, (yes|no) "no"</remarks>
|
||||
public string? Default { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
@@ -3,22 +3,22 @@ namespace SabreTools.Models.ClrMamePro
|
||||
/// <remarks>input</remarks>
|
||||
public class Input
|
||||
{
|
||||
/// <remarks>players, Numeric?</remarks>
|
||||
/// <remarks>players, Numeric?/remarks>
|
||||
public string Players { get; set; }
|
||||
|
||||
/// <remarks>control</remarks>
|
||||
public string? Control { get; set; }
|
||||
|
||||
/// <remarks>buttons, Numeric?</remarks>
|
||||
/// <remarks>buttons, Numeric</remarks>
|
||||
public string Buttons { get; set; }
|
||||
|
||||
/// <remarks>coins, Numeric?</remarks>
|
||||
/// <remarks>coins, Numeric</remarks>
|
||||
public string? Coins { get; set; }
|
||||
|
||||
/// <remarks>tilt, Boolean?</remarks>
|
||||
/// <remarks>tilt, (yes|no) "no"</remarks>
|
||||
public string? Tilt { get; set; }
|
||||
|
||||
/// <remarks>service, Boolean?</remarks>
|
||||
/// <remarks>service, (yes|no) "no"</remarks>
|
||||
public string? Service { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace SabreTools.Models.ClrMamePro
|
||||
public string? Region { get; set; }
|
||||
|
||||
/// <remarks>offs; Appears after Flags</remarks>
|
||||
public string? Offs { get; set; } // TODO: Is this "Offset" elsewhere?
|
||||
public string? Offs { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
24
SabreTools.Models/Internal/Adjuster.cs
Normal file
24
SabreTools.Models/Internal/Adjuster.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("adjuster"), XmlRoot("adjuster")]
|
||||
public class Adjuster : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
// <remarks>Condition</remarks>
|
||||
public const string ConditionKey = "condition";
|
||||
|
||||
/// <remarks>bool</remarks>
|
||||
public const string DefaultKey = "default";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
#endregion
|
||||
|
||||
public Adjuster() => Type = ItemType.Adjuster;
|
||||
}
|
||||
}
|
||||
18
SabreTools.Models/Internal/Analog.cs
Normal file
18
SabreTools.Models/Internal/Analog.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("analog"), XmlRoot("analog")]
|
||||
public class Analog : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string MaskKey = "mask";
|
||||
|
||||
#endregion
|
||||
|
||||
public Analog() => Type = ItemType.Analog;
|
||||
}
|
||||
}
|
||||
18
SabreTools.Models/Internal/Archive.cs
Normal file
18
SabreTools.Models/Internal/Archive.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("archive"), XmlRoot("archive")]
|
||||
public class Archive : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
#endregion
|
||||
|
||||
public Archive() => Type = ItemType.Archive;
|
||||
}
|
||||
}
|
||||
24
SabreTools.Models/Internal/BiosSet.cs
Normal file
24
SabreTools.Models/Internal/BiosSet.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("biosset"), XmlRoot("biosset")]
|
||||
public class BiosSet : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>bool</remarks>
|
||||
public const string DefaultKey = "default";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string DescriptionKey = "description";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
#endregion
|
||||
|
||||
public BiosSet() => Type = ItemType.BiosSet;
|
||||
}
|
||||
}
|
||||
11
SabreTools.Models/Internal/Blank.cs
Normal file
11
SabreTools.Models/Internal/Blank.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("blank"), XmlRoot("blank")]
|
||||
public class Blank : DatItem
|
||||
{
|
||||
public Blank() => Type = ItemType.Blank;
|
||||
}
|
||||
}
|
||||
33
SabreTools.Models/Internal/Chip.cs
Normal file
33
SabreTools.Models/Internal/Chip.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("chip"), XmlRoot("chip")]
|
||||
public class Chip : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string ClockKey = "clock";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string FlagsKey = "flags";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string SoundOnlyKey = "soundonly";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string TagKey = "tag";
|
||||
|
||||
/// <remarks>(cpu|audio)</remarks>
|
||||
public const string ChipTypeKey = "type";
|
||||
|
||||
#endregion
|
||||
|
||||
public Chip() => Type = ItemType.Chip;
|
||||
}
|
||||
}
|
||||
27
SabreTools.Models/Internal/Condition.cs
Normal file
27
SabreTools.Models/Internal/Condition.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("condition"), XmlRoot("condition")]
|
||||
public class Condition : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string ValueKey = "clock";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string MaskKey = "mask";
|
||||
|
||||
/// <remarks>(eq|ne|gt|le|lt|ge)</remarks>
|
||||
public const string RelationKey = "relation";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string TagKey = "tag";
|
||||
|
||||
#endregion
|
||||
|
||||
public Condition() => Type = ItemType.Condition;
|
||||
}
|
||||
}
|
||||
24
SabreTools.Models/Internal/ConfLocation.cs
Normal file
24
SabreTools.Models/Internal/ConfLocation.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("conflocation"), XmlRoot("conflocation")]
|
||||
public class ConfLocation : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string InvertedKey = "inverted";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
/// <remarks>string, possibly long</remarks>
|
||||
public const string NumberKey = "number";
|
||||
|
||||
#endregion
|
||||
|
||||
public ConfLocation() => Type = ItemType.ConfLocation;
|
||||
}
|
||||
}
|
||||
27
SabreTools.Models/Internal/ConfSetting.cs
Normal file
27
SabreTools.Models/Internal/ConfSetting.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("confsetting"), XmlRoot("confsetting")]
|
||||
public class ConfSetting : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>Condition</remarks>
|
||||
public const string ConditionKey = "condition";
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string DefaultKey = "default";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string ValueKey = "value";
|
||||
|
||||
#endregion
|
||||
|
||||
public ConfSetting() => Type = ItemType.ConfSetting;
|
||||
}
|
||||
}
|
||||
33
SabreTools.Models/Internal/Configuration.cs
Normal file
33
SabreTools.Models/Internal/Configuration.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("configuration"), XmlRoot("configuration")]
|
||||
public class Configuration : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>Condition</remarks>
|
||||
public const string ConditionKey = "condition";
|
||||
|
||||
/// <remarks>ConfLocation[]</remarks>
|
||||
public const string ConfLocationKey = "conflocation";
|
||||
|
||||
/// <remarks>ConfSetting[]</remarks>
|
||||
public const string ConfSettingKey = "confsetting";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string MaskKey = "mask";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string TagKey = "tag";
|
||||
|
||||
#endregion
|
||||
|
||||
public Configuration() => Type = ItemType.Configuration;
|
||||
}
|
||||
}
|
||||
51
SabreTools.Models/Internal/Control.cs
Normal file
51
SabreTools.Models/Internal/Control.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("control"), XmlRoot("control")]
|
||||
public class Control : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string ButtonsKey = "buttons";
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string KeyDeltaKey = "keydelta";
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string MaximumKey = "maximum";
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string MinimumKey = "minimum";
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string PlayerKey = "player";
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string ReqButtonsKey = "reqbuttons";
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string ReverseKey = "reverse";
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string Sensitivity = "sensitivity";
|
||||
|
||||
/// <remarks>(joy|stick|paddle|pedal|lightgun|positional|dial|trackball|mouse|only_buttons|keypad|keyboard|mahjong|hanafuda|gambling)</remarks>
|
||||
public const string ControlTypeKey = "type";
|
||||
|
||||
/// <remarks>string, possibly long</remarks>
|
||||
public const string WaysKey = "ways";
|
||||
|
||||
/// <remarks>string, possibly long</remarks>
|
||||
public const string Ways2Key = "ways2";
|
||||
|
||||
/// <remarks>string, possibly long</remarks>
|
||||
public const string Ways3Key = "ways3";
|
||||
|
||||
#endregion
|
||||
|
||||
public Control() => Type = ItemType.Control;
|
||||
}
|
||||
}
|
||||
80
SabreTools.Models/Internal/DatItem.cs
Normal file
80
SabreTools.Models/Internal/DatItem.cs
Normal file
@@ -0,0 +1,80 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Format-agnostic representation of item data
|
||||
/// </summary>
|
||||
public class DatItem : Dictionary<string, object?>
|
||||
{
|
||||
#region Common Keys
|
||||
|
||||
public const string TypeKey = "_type";
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Quick accessor to item type, if it exists
|
||||
/// </summary>
|
||||
[JsonProperty("itemtype", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("itemtype")]
|
||||
public ItemType? Type
|
||||
{
|
||||
get => ContainsKey(TypeKey) ? this[TypeKey] as ItemType? : null;
|
||||
set => this[TypeKey] = value;
|
||||
}
|
||||
|
||||
#region Reading Helpers
|
||||
|
||||
/// <summary>
|
||||
/// Read a key as a bool, returning null on error
|
||||
/// </summary>
|
||||
public bool? ReadBool(string key)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(key))
|
||||
return null;
|
||||
if (!ContainsKey(key))
|
||||
return null;
|
||||
return this[key] as bool?;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read a key as a double, returning null on error
|
||||
/// </summary>
|
||||
public double? ReadDouble(string key)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(key))
|
||||
return null;
|
||||
if (!ContainsKey(key))
|
||||
return null;
|
||||
return this[key] as double?;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read a key as a long, returning null on error
|
||||
/// </summary>
|
||||
public long? ReadLong(string key)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(key))
|
||||
return null;
|
||||
if (!ContainsKey(key))
|
||||
return null;
|
||||
return this[key] as long?;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read a key as a string, returning null on error
|
||||
/// </summary>
|
||||
public string? ReadString(string key)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(key))
|
||||
return null;
|
||||
if (!ContainsKey(key))
|
||||
return null;
|
||||
return this[key] as string;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
30
SabreTools.Models/Internal/DataArea.cs
Normal file
30
SabreTools.Models/Internal/DataArea.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("dataarea"), XmlRoot("dataarea")]
|
||||
public class DataArea : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>(big|little) "little"</remarks>
|
||||
public const string EndiannessKey = "endianness";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
/// <remarks>Rom[]</remarks>
|
||||
public const string RomKey = "rom";
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string SizeKey = "size";
|
||||
|
||||
/// <remarks>(8|16|32|64) "8"</remarks>
|
||||
public const string WidthKey = "width";
|
||||
|
||||
#endregion
|
||||
|
||||
public DataArea() => Type = ItemType.DataArea;
|
||||
}
|
||||
}
|
||||
36
SabreTools.Models/Internal/Device.cs
Normal file
36
SabreTools.Models/Internal/Device.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("device"), XmlRoot("device")]
|
||||
public class Device : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>Extension[]</remarks>
|
||||
public const string ExtensionKey = "extension";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string FixedImageKey = "fixed_image";
|
||||
|
||||
/// <remarks>Instance</remarks>
|
||||
public const string InstanceKey = "instance";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string InterfaceKey = "interface";
|
||||
|
||||
/// <remarks>(0|1) "0"</remarks>
|
||||
public const string MandatoryKey = "mandatory";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string TagKey = "tag";
|
||||
|
||||
/// <remarks>(unknown|cartridge|floppydisk|harddisk|cylinder|cassette|punchcard|punchtape|printout|serial|parallel|snapshot|quickload|memcard|cdrom|magtape|romimage|midiin|midiout|picture|vidfile)</remarks>
|
||||
public const string DeviceTypeKey = "type";
|
||||
|
||||
#endregion
|
||||
|
||||
public Device() => Type = ItemType.Device;
|
||||
}
|
||||
}
|
||||
18
SabreTools.Models/Internal/DeviceRef.cs
Normal file
18
SabreTools.Models/Internal/DeviceRef.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("device_ref"), XmlRoot("device_ref")]
|
||||
public class DeviceRef : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
#endregion
|
||||
|
||||
public DeviceRef() => Type = ItemType.DeviceRef;
|
||||
}
|
||||
}
|
||||
24
SabreTools.Models/Internal/DipLocation.cs
Normal file
24
SabreTools.Models/Internal/DipLocation.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("diplocation"), XmlRoot("diplocation")]
|
||||
public class DipLocation : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string InvertedKey = "inverted";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
/// <remarks>string, possibly long</remarks>
|
||||
public const string NumberKey = "number";
|
||||
|
||||
#endregion
|
||||
|
||||
public DipLocation() => Type = ItemType.DipLocation;
|
||||
}
|
||||
}
|
||||
39
SabreTools.Models/Internal/DipSwitch.cs
Normal file
39
SabreTools.Models/Internal/DipSwitch.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("dipswitch"), XmlRoot("dipswitch")]
|
||||
public class DipSwitch : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>Condition</remarks>
|
||||
public const string ConditionKey = "condition";
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string DefaultKey = "default";
|
||||
|
||||
/// <remarks>DipLocation[]</remarks>
|
||||
public const string DipLocationKey = "diplocation";
|
||||
|
||||
/// <remarks>DipValue[]</remarks>
|
||||
public const string DipValueKey = "dipvalue";
|
||||
|
||||
/// <remarks>string[]</remarks>
|
||||
public const string EntryKey = "entry";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string MaskKey = "mask";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string TagKey = "tag";
|
||||
|
||||
#endregion
|
||||
|
||||
public DipSwitch() => Type = ItemType.DipSwitch;
|
||||
}
|
||||
}
|
||||
27
SabreTools.Models/Internal/DipValue.cs
Normal file
27
SabreTools.Models/Internal/DipValue.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("dipvalue"), XmlRoot("dipvalue")]
|
||||
public class DipValue : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>Condition</remarks>
|
||||
public const string ConditionKey = "condition";
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string DefaultKey = "default";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string ValueKey = "value";
|
||||
|
||||
#endregion
|
||||
|
||||
public DipValue() => Type = ItemType.DipValue;
|
||||
}
|
||||
}
|
||||
45
SabreTools.Models/Internal/Disk.cs
Normal file
45
SabreTools.Models/Internal/Disk.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("disk"), XmlRoot(elementName: "disk")]
|
||||
public class Disk : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string FlagsKey = "flags";
|
||||
|
||||
/// <remarks>string, possibly long</remarks>
|
||||
public const string IndexKey = "index";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string MD5Key = "md5";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string MergeKey = "merge";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string OptionalKey = "optional";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string RegionKey = "region";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string SHA1Key = "sha1";
|
||||
|
||||
/// <remarks>(baddump|nodump|good|verified) "good"</remarks>
|
||||
public const string StatusKey = "status";
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string WritableKey = "writable";
|
||||
|
||||
#endregion
|
||||
|
||||
public Disk() => Type = ItemType.Disk;
|
||||
}
|
||||
}
|
||||
21
SabreTools.Models/Internal/DiskArea.cs
Normal file
21
SabreTools.Models/Internal/DiskArea.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("diskarea"), XmlRoot("diskarea")]
|
||||
public class DiskArea : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>Disk[]</remarks>
|
||||
public const string DiskKey = "disk";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
#endregion
|
||||
|
||||
public DiskArea() => Type = ItemType.DiskArea;
|
||||
}
|
||||
}
|
||||
57
SabreTools.Models/Internal/Display.cs
Normal file
57
SabreTools.Models/Internal/Display.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("display"), XmlRoot("display")]
|
||||
public class Display : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string FlipXKey = "flipx";
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string HBEndKey = "hbend";
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string HBStart = "hbstart";
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string HeightKey = "height";
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string HTotalKey = "htotal";
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string PixClockKey = "pixclock";
|
||||
|
||||
/// <remarks>double</remarks>
|
||||
public const string RefreshKey = "refresh";
|
||||
|
||||
/// <remarks>(0|90|180|270)</remarks>
|
||||
public const string RotateKey = "rotate";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string TagKey = "tag";
|
||||
|
||||
/// <remarks>(raster|vector|lcd|svg|unknown)</remarks>
|
||||
public const string DisplayTypeKey = "type";
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string VBEndKey = "vbend";
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string VBStartKey = "vbstart";
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string VTotalKey = "vtotal";
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string WidthKey = "width";
|
||||
|
||||
#endregion
|
||||
|
||||
public Display() => Type = ItemType.Display;
|
||||
}
|
||||
}
|
||||
51
SabreTools.Models/Internal/Driver.cs
Normal file
51
SabreTools.Models/Internal/Driver.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("driver"), XmlRoot("driver")]
|
||||
public class Driver : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>(plain|dirty)</remarks>
|
||||
public const string BlitKey = "blit";
|
||||
|
||||
/// <remarks>(good|imperfect|preliminary)</remarks>
|
||||
public const string CocktailKey = "cocktail";
|
||||
|
||||
/// <remarks>(good|imperfect|preliminary)</remarks>
|
||||
public const string ColorKey = "color";
|
||||
|
||||
/// <remarks>(good|imperfect|preliminary)</remarks>
|
||||
public const string EmulationKey = "emulation";
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string IncompleteKey = "incomplete";
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string NoSoundHardwareKey = "nosoundhardware";
|
||||
|
||||
/// <remarks>string, possibly long</remarks>
|
||||
public const string PaletteSizeKey = "palettesize";
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string RequiresArtworkKey = "requiresartwork";
|
||||
|
||||
/// <remarks>(supported|unsupported)</remarks>
|
||||
public const string SaveStateKey = "savestate";
|
||||
|
||||
/// <remarks>(good|imperfect|preliminary)</remarks>
|
||||
public const string SoundKey = "sound";
|
||||
|
||||
/// <remarks>(good|imperfect|preliminary|test)</remarks>
|
||||
public const string StatusKey = "status";
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string UnofficialKey = "unofficial";
|
||||
|
||||
#endregion
|
||||
|
||||
public Driver() => Type = ItemType.Driver;
|
||||
}
|
||||
}
|
||||
27
SabreTools.Models/Internal/Dump.cs
Normal file
27
SabreTools.Models/Internal/Dump.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("dump"), XmlRoot("dump")]
|
||||
public class Dump : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>Rom</remarks>
|
||||
public const string MegaRomKey = "megarom";
|
||||
|
||||
/// <remarks>Original</remarks>
|
||||
public const string OriginalKey = "original";
|
||||
|
||||
/// <remarks>Rom</remarks>
|
||||
public const string RomKey = "rom";
|
||||
|
||||
/// <remarks>Rom</remarks>
|
||||
public const string SCCPlusCartKey = "sccpluscart";
|
||||
|
||||
#endregion
|
||||
|
||||
public Dump() => Type = ItemType.Dump;
|
||||
}
|
||||
}
|
||||
18
SabreTools.Models/Internal/Extension.cs
Normal file
18
SabreTools.Models/Internal/Extension.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("extension"), XmlRoot("extension")]
|
||||
public class Extension : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
#endregion
|
||||
|
||||
public Extension() => Type = ItemType.Extension;
|
||||
}
|
||||
}
|
||||
30
SabreTools.Models/Internal/Feature.cs
Normal file
30
SabreTools.Models/Internal/Feature.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("feature"), XmlRoot("feature")]
|
||||
public class Feature : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
/// <remarks>(unemulated|imperfect)</remarks>
|
||||
public const string OverallKey = "overall";
|
||||
|
||||
/// <remarks>(unemulated|imperfect)</remarks>
|
||||
public const string StatusKey = "status";
|
||||
|
||||
/// <remarks>(protection|timing|graphics|palette|sound|capture|camera|microphone|controls|keyboard|mouse|media|disk|printer|tape|punch|drum|rom|comms|lan|wan)</remarks>
|
||||
public const string FeatureTypeKey = "type";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string ValueKey = "value";
|
||||
|
||||
#endregion
|
||||
|
||||
public Feature() => Type = ItemType.Feature;
|
||||
}
|
||||
}
|
||||
21
SabreTools.Models/Internal/Info.cs
Normal file
21
SabreTools.Models/Internal/Info.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("info"), XmlRoot("info")]
|
||||
public class Info : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string ValueKey = "value";
|
||||
|
||||
#endregion
|
||||
|
||||
public Info() => Type = ItemType.Info;
|
||||
}
|
||||
}
|
||||
33
SabreTools.Models/Internal/Input.cs
Normal file
33
SabreTools.Models/Internal/Input.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("input"), XmlRoot("input")]
|
||||
public class Input : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string ButtonsKey = "buttons";
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string CoinsKey = "coins";
|
||||
|
||||
/// <remarks>string / Control[]</remarks>
|
||||
public const string ControlKey = "control";
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string PlayersKey = "players";
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string ServiceKey = "service";
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string TiltKey = "tilt";
|
||||
|
||||
#endregion
|
||||
|
||||
public Input() => Type = ItemType.Input;
|
||||
}
|
||||
}
|
||||
21
SabreTools.Models/Internal/Instance.cs
Normal file
21
SabreTools.Models/Internal/Instance.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("instance"), XmlRoot("instance")]
|
||||
public class Instance : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string BriefNameKey = "briefname";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
#endregion
|
||||
|
||||
public Instance() => Type = ItemType.Instance;
|
||||
}
|
||||
}
|
||||
60
SabreTools.Models/Internal/ItemType.cs
Normal file
60
SabreTools.Models/Internal/ItemType.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Determine what type of file an item is
|
||||
/// </summary>
|
||||
public enum ItemType
|
||||
{
|
||||
/// <summary>
|
||||
/// This is a fake flag that is used for filter only
|
||||
/// </summary>
|
||||
NULL = 0,
|
||||
|
||||
Adjuster,
|
||||
Analog,
|
||||
Archive,
|
||||
BiosSet,
|
||||
Chip,
|
||||
Condition,
|
||||
Configuration,
|
||||
ConfLocation,
|
||||
ConfSetting,
|
||||
Control,
|
||||
DataArea,
|
||||
Device,
|
||||
DeviceRef,
|
||||
DipLocation,
|
||||
DipSwitch,
|
||||
DipValue,
|
||||
Disk,
|
||||
DiskArea,
|
||||
Display,
|
||||
Driver,
|
||||
Dump,
|
||||
Extension,
|
||||
Feature,
|
||||
Info,
|
||||
Input,
|
||||
Instance,
|
||||
Media,
|
||||
Original,
|
||||
Part,
|
||||
Port,
|
||||
RamOption,
|
||||
Release,
|
||||
Rom,
|
||||
Sample,
|
||||
SharedFeat,
|
||||
Slot,
|
||||
SlotOption,
|
||||
Software,
|
||||
SoftwareList,
|
||||
Sound,
|
||||
Video,
|
||||
|
||||
/// <summary>
|
||||
/// This is not a real type, only used internally
|
||||
/// </summary>
|
||||
Blank = int.MaxValue,
|
||||
}
|
||||
}
|
||||
30
SabreTools.Models/Internal/Media.cs
Normal file
30
SabreTools.Models/Internal/Media.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("media"), XmlRoot("media")]
|
||||
public class Media : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string MD5Key = "md5";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string SHA1Key = "sha1";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string SHA256Key = "sha256";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string SpamSumKey = "spamsum";
|
||||
|
||||
#endregion
|
||||
|
||||
public Media() => Type = ItemType.Media;
|
||||
}
|
||||
}
|
||||
21
SabreTools.Models/Internal/Original.cs
Normal file
21
SabreTools.Models/Internal/Original.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("original"), XmlRoot("original")]
|
||||
public class Original : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string ContentKey = "content";
|
||||
|
||||
/// <remarks>bool</remarks>
|
||||
public const string ValueKey = "value";
|
||||
|
||||
#endregion
|
||||
|
||||
public Original() => Type = ItemType.Original;
|
||||
}
|
||||
}
|
||||
33
SabreTools.Models/Internal/Part.cs
Normal file
33
SabreTools.Models/Internal/Part.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("part"), XmlRoot("part")]
|
||||
public class Part : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>DataArea[]</remarks>
|
||||
public const string DataAreaKey = "dataarea";
|
||||
|
||||
/// <remarks>DiskArea[]</remarks>
|
||||
public const string DiskAreaKey = "diskarea";
|
||||
|
||||
/// <remarks>DipSwitch[]</remarks>
|
||||
public const string DipSwitchKey = "dipswitch";
|
||||
|
||||
/// <remarks>Feature[]</remarks>
|
||||
public const string FeatureKey = "feature";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string InterfaceKey = "interface";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
#endregion
|
||||
|
||||
public Part() => Type = ItemType.Part;
|
||||
}
|
||||
}
|
||||
21
SabreTools.Models/Internal/Port.cs
Normal file
21
SabreTools.Models/Internal/Port.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("port"), XmlRoot("port")]
|
||||
public class Port : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>Analog[]</remarks>
|
||||
public const string AnalogKey = "analog";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string TagKey = "tag";
|
||||
|
||||
#endregion
|
||||
|
||||
public Port() => Type = ItemType.Port;
|
||||
}
|
||||
}
|
||||
21
SabreTools.Models/Internal/RamOption.cs
Normal file
21
SabreTools.Models/Internal/RamOption.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("ramoption"), XmlRoot("ramoption")]
|
||||
public class RamOption : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string DefaultKey = "default";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
#endregion
|
||||
|
||||
public RamOption() => Type = ItemType.RamOption;
|
||||
}
|
||||
}
|
||||
30
SabreTools.Models/Internal/Release.cs
Normal file
30
SabreTools.Models/Internal/Release.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("release"), XmlRoot("release")]
|
||||
public class Release : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string DateKey = "date";
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string DefaultKey = "default";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string LanguageKey = "language";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string RegionKey = "region";
|
||||
|
||||
#endregion
|
||||
|
||||
public Release() => Type = ItemType.Release;
|
||||
}
|
||||
}
|
||||
285
SabreTools.Models/Internal/Rom.cs
Normal file
285
SabreTools.Models/Internal/Rom.cs
Normal file
@@ -0,0 +1,285 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("rom"), XmlRoot("rom")]
|
||||
public class Rom : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string AlbumKey = "album";
|
||||
|
||||
/// <remarks>string; AttractMode.Row</remarks>
|
||||
public const string AltRomnameKey = "alt_romname";
|
||||
|
||||
/// <remarks>string; AttractMode.Row</remarks>
|
||||
public const string AltTitleKey = "alt_title";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string ArtistKey = "artist";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string ASRDetectedLangKey = "asr_detected_lang";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string ASRDetectedLangConfKey = "asr_detected_lang_conf";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string ASRTranscribedLang = "asr_transcribed_lang";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string BiosKey = "bios";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string BitrateKey = "bitrate";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string BitTorrentMagnetHashKey = "btih";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string ClothCoverDetectionModuleVersionKey = "cloth_cover_detection_module_version";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string CollectionCatalogNumberKey = "collection-catalog-number";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string CommentKey = "comment";
|
||||
|
||||
/// <remarks>string; Also "crc32" in ArchiveDotOrg.File</remarks>
|
||||
public const string CRCKey = "crc";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string CreatorKey = "creator";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string DateKey = "date";
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string DisposeKey = "dispose";
|
||||
|
||||
/// <remarks>string; OfflineList.FileRomCRC</remarks>
|
||||
public const string ExtensionKey = "extension";
|
||||
|
||||
/// <remarks>long; ArchiveDotOrg.File</remarks>
|
||||
public const string FileCountKey = "filecount";
|
||||
|
||||
/// <remarks>bool; AttractMode.Row</remarks>
|
||||
public const string FileIsAvailable = "file_is_available";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string FlagsKey = "flags";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string FormatKey = "format";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string HeaderKey = "header";
|
||||
|
||||
/// <remarks>string, possibly long; ArchiveDotOrg.File</remarks>
|
||||
public const string HeightKey = "height";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string hOCRCharToWordhOCRVersionKey = "hocr_char_to_word_hocr_version";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string hOCRCharToWordModuleVersionKey = "hocr_char_to_word_module_version";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string hOCRFtsTexthOCRVersionKey = "hocr_fts_text_hocr_version";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string hOCRFtsTextModuleVersionKey = "hocr_fts_text_module_version";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string hOCRPageIndexhOCRVersionKey = "hocr_pageindex_hocr_version";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string hOCRPageIndexModuleVersionKey = "hocr_pageindex_module_version";
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string InvertedKey = "inverted";
|
||||
|
||||
/// <remarks>long; ArchiveDotOrg.File</remarks>
|
||||
public const string LastModifiedTimeKey = "mtime";
|
||||
|
||||
/// <remarks>string, possibly long; Also in ArchiveDotOrg.File</remarks>
|
||||
public const string LengthKey = "length";
|
||||
|
||||
/// <remarks>(load16_byte|load16_word|load16_word_swap|load32_byte|load32_word|load32_word_swap|load32_dword|load64_word|load64_word_swap|reload|fill|continue|reload_plain|ignore)</remarks>
|
||||
public const string LoadFlagKey = "loadflag";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string MatrixNumberKey = "matrix_number";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string MD5Key = "md5";
|
||||
|
||||
/// <remarks>string; OpenMSX.RomBase</remarks>
|
||||
public const string OpenMSXMediaType = "mediatype";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string MergeKey = "merge";
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string MIAKey = "mia";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string TesseractOCRKey = "ocr";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string TesseractOCRConvertedKey = "ocr_converted";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string TesseractOCRDetectedLangKey = "ocr_detected_lang";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string TesseractOCRDetectedLangConfKey = "ocr_detected_lang_conf";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string TesseractOCRDetectedScriptKey = "ocr_detected_script";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string TesseractOCRDetectedScriptConfKey = "ocr_detected_script_conf";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string TesseractOCRModuleVersionKey = "ocr_module_version";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string TesseractOCRParametersKey = "ocr_parameters";
|
||||
|
||||
/// <remarks>string, possibly long; Originally "offs"</remarks>
|
||||
public const string OffsetKey = "offset";
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string OptionalKey = "optional";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string OriginalKey = "original";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string PDFModuleVersionKey = "pdf_module_version";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string PreviewImageKey = "preview-image";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string PublisherKey = "publisher";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string RegionKey = "region";
|
||||
|
||||
/// <remarks>string; OpenMSX.RomBase</remarks>
|
||||
public const string RemarkKey = "remark";
|
||||
|
||||
/// <remarks>string, possibly long; ArchiveDotOrg.File</remarks>
|
||||
public const string RotationKey = "rotation";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string SerialKey = "serial";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string SHA1Key = "sha1";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string SHA256Key = "sha256";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string SHA384Key = "sha384";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string SHA512Key = "sha512";
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string SizeKey = "size";
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string SoundOnlyKey = "soundonly";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string SourceKey = "source";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string SpamSumKey = "spamsum";
|
||||
|
||||
/// <remarks>string, possibly long; OpenMSX.RomBase</remarks>
|
||||
public const string StartKey = "start";
|
||||
|
||||
/// <remarks>(baddump|nodump|good|verified) "good"</remarks>
|
||||
public const string StatusKey = "status";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string SummationKey = "summation";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string TitleKey = "title";
|
||||
|
||||
/// <remarks>string, possibly long; ArchiveDotOrg.File</remarks>
|
||||
public const string TrackKey = "track";
|
||||
|
||||
/// <remarks>string; OpenMSX.RomBase</remarks>
|
||||
public const string OpenMSXType = "type";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string ValueKey = "value";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string WhisperASRModuleVersionKey = "whisper_asr_module_version";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string WhisperModelHashKey = "whisper_model_hash";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string WhisperModelNameKey = "whisper_model_name";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string WhisperVersionKey = "whisper_version";
|
||||
|
||||
/// <remarks>string, possibly long; ArchiveDotOrg.File</remarks>
|
||||
public const string WidthKey = "width";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string WordConfidenceInterval0To10Key = "word_conf_0_10";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string WordConfidenceInterval11To20Key = "word_conf_11_20";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string WordConfidenceInterval21To30Key = "word_conf_21_30";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string WordConfidenceInterval31To40Key = "word_conf_31_40";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string WordConfidenceInterval41To50Key = "word_conf_41_50";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string WordConfidenceInterval51To60Key = "word_conf_51_60";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string WordConfidenceInterval61To70Key = "word_conf_61_70";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string WordConfidenceInterval71To80Key = "word_conf_71_80";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string WordConfidenceInterval81To90Key = "word_conf_81_90";
|
||||
|
||||
/// <remarks>string; ArchiveDotOrg.File</remarks>
|
||||
public const string WordConfidenceInterval91To100Key = "word_conf_91_100";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string xxHash364Key = "xxh3_64";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string xxHash3128Key = "xxh3_128";
|
||||
|
||||
#endregion
|
||||
|
||||
public Rom() => Type = ItemType.Rom;
|
||||
}
|
||||
}
|
||||
18
SabreTools.Models/Internal/Sample.cs
Normal file
18
SabreTools.Models/Internal/Sample.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("sample"), XmlRoot("sample")]
|
||||
public class Sample : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
#endregion
|
||||
|
||||
public Sample() => Type = ItemType.Sample;
|
||||
}
|
||||
}
|
||||
21
SabreTools.Models/Internal/SharedFeat.cs
Normal file
21
SabreTools.Models/Internal/SharedFeat.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("sharedfeat"), XmlRoot("sharedfeat")]
|
||||
public class SharedFeat : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string ValueKey = "value";
|
||||
|
||||
#endregion
|
||||
|
||||
public SharedFeat() => Type = ItemType.SharedFeat;
|
||||
}
|
||||
}
|
||||
21
SabreTools.Models/Internal/Slot.cs
Normal file
21
SabreTools.Models/Internal/Slot.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("slot"), XmlRoot("slot")]
|
||||
public class Slot : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
/// <remarks>SlotOption[]</remarks>
|
||||
public const string SlotOptionKey = "slotoption";
|
||||
|
||||
#endregion
|
||||
|
||||
public Slot() => Type = ItemType.Slot;
|
||||
}
|
||||
}
|
||||
24
SabreTools.Models/Internal/SlotOption.cs
Normal file
24
SabreTools.Models/Internal/SlotOption.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("slotoption"), XmlRoot("slotoption")]
|
||||
public class SlotOption : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>(yes|no) "no"</remarks>
|
||||
public const string DefaultKey = "default";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string DevNameKey = "devname";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
#endregion
|
||||
|
||||
public SlotOption() => Type = ItemType.SlotOption;
|
||||
}
|
||||
}
|
||||
45
SabreTools.Models/Internal/Software.cs
Normal file
45
SabreTools.Models/Internal/Software.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("software"), XmlRoot("software")]
|
||||
public class Software : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string CloneOfKey = "cloneof";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string DescriptionKey = "description";
|
||||
|
||||
/// <remarks>Info[]</remarks>
|
||||
public const string InfoKey = "info";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NotesKey = "notes";
|
||||
|
||||
/// <remarks>Part[]</remarks>
|
||||
public const string PartKey = "part";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string PublisherKey = "publisher";
|
||||
|
||||
/// <remarks>SharedFeat[]</remarks>
|
||||
public const string SharedFeatKey = "sharedfeat";
|
||||
|
||||
/// <remarks>(yes|partial|no) "yes"</remarks>
|
||||
public const string SupportedKey = "supported";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string YearKey = "year";
|
||||
|
||||
#endregion
|
||||
|
||||
public Software() => Type = ItemType.Software;
|
||||
}
|
||||
}
|
||||
36
SabreTools.Models/Internal/SoftwareList.cs
Normal file
36
SabreTools.Models/Internal/SoftwareList.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("softwarelist"), XmlRoot("softwarelist")]
|
||||
public class SoftwareList : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string DescriptionKey = "description";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string FilterKey = "filter";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NameKey = "name";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string NotesKey = "notes";
|
||||
|
||||
/// <remarks>Software[]</remarks>
|
||||
public const string SoftwareKey = "software";
|
||||
|
||||
/// <remarks>(original|compatible)</remarks>
|
||||
public const string StatusKey = "status";
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string TagKey = "tag";
|
||||
|
||||
#endregion
|
||||
|
||||
public SoftwareList() => Type = ItemType.SoftwareList;
|
||||
}
|
||||
}
|
||||
18
SabreTools.Models/Internal/Sound.cs
Normal file
18
SabreTools.Models/Internal/Sound.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("sound"), XmlRoot("sound")]
|
||||
public class Sound : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string ChannelsKey = "channels";
|
||||
|
||||
#endregion
|
||||
|
||||
public Sound() => Type = ItemType.Sound;
|
||||
}
|
||||
}
|
||||
36
SabreTools.Models/Internal/Video.cs
Normal file
36
SabreTools.Models/Internal/Video.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Models.Internal
|
||||
{
|
||||
[JsonObject("video"), XmlRoot("video")]
|
||||
public class Video : DatItem
|
||||
{
|
||||
#region Keys
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string AspectXKey = "aspectx";
|
||||
|
||||
/// <remarks>long</remarks>
|
||||
public const string AspectYKey = "aspecty";
|
||||
|
||||
/// <remarks>long; Originally "y"</remarks>
|
||||
public const string HeightKey = "height";
|
||||
|
||||
/// <remarks>(vertical|horizontal)</remarks>
|
||||
public const string OrientationKey = "orientation";
|
||||
|
||||
/// <remarks>double; Originally "freq"</remarks>
|
||||
public const string RefreshKey = "refresh";
|
||||
|
||||
/// <remarks>(raster|vector)</remarks>
|
||||
public const string ScreenKey = "screen";
|
||||
|
||||
/// <remarks>long; Originally "x"</remarks>
|
||||
public const string WidthKey = "width";
|
||||
|
||||
#endregion
|
||||
|
||||
public Video() => Type = ItemType.Video;
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ namespace SabreTools.Models.Listxml
|
||||
[XmlAttribute("region")]
|
||||
public string? Region { get; set; }
|
||||
|
||||
/// <remarks>Numeric?</remarks>
|
||||
/// <remarks>Numeric</remarks>
|
||||
[XmlAttribute("offset")]
|
||||
public string? Offset { get; set; }
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace SabreTools.Models.Listxml
|
||||
[XmlRoot("sound")]
|
||||
public class Sound
|
||||
{
|
||||
/// <remarks>Numeric?</remarks>
|
||||
/// <remarks>Numeric</remarks>
|
||||
[XmlAttribute("channels")]
|
||||
public string Channels { get; set; }
|
||||
|
||||
|
||||
@@ -14,23 +14,23 @@ namespace SabreTools.Models.Listxml
|
||||
[XmlAttribute("orientation")]
|
||||
public string Orientation { get; set; }
|
||||
|
||||
/// <remarks>Numeric?</remarks>
|
||||
/// <remarks>Numeric</remarks>
|
||||
[XmlAttribute("width")]
|
||||
public string? Width { get; set; }
|
||||
|
||||
/// <remarks>Numeric?</remarks>
|
||||
/// <remarks>Numeric</remarks>
|
||||
[XmlAttribute("height")]
|
||||
public string? Height { get; set; }
|
||||
|
||||
/// <remarks>Numeric?</remarks>
|
||||
/// <remarks>Numeric</remarks>
|
||||
[XmlAttribute("aspectx")]
|
||||
public string? AspectX { get; set; }
|
||||
|
||||
/// <remarks>Numeric?</remarks>
|
||||
/// <remarks>Numeric</remarks>
|
||||
[XmlAttribute("aspecty")]
|
||||
public string? AspectY { get; set; }
|
||||
|
||||
/// <remarks>Numeric?</remarks>
|
||||
/// <remarks>Numeric</remarks>
|
||||
[XmlAttribute("refresh")]
|
||||
public string? Refresh { get; set; }
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace SabreTools.Models.OpenMSX
|
||||
[XmlElement("type")]
|
||||
public string? Type { get; set; }
|
||||
|
||||
/// <remarks>SHA-1 hash</remarks>
|
||||
[XmlElement("hash")]
|
||||
public string? Hash { get; set; }
|
||||
|
||||
|
||||
@@ -5,4 +5,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user