2020-08-21 16:48:56 -07:00
|
|
|
|
using System.Collections.Generic;
|
2020-09-02 22:38:00 -07:00
|
|
|
|
using System.IO;
|
2020-09-02 16:31:23 -07:00
|
|
|
|
using System.Linq;
|
2020-08-21 16:48:56 -07:00
|
|
|
|
|
2020-09-02 16:31:23 -07:00
|
|
|
|
using SabreTools.Library.DatItems;
|
|
|
|
|
|
using SabreTools.Library.Filtering;
|
2020-08-23 21:10:29 -07:00
|
|
|
|
using Newtonsoft.Json;
|
2020-09-02 15:38:10 -07:00
|
|
|
|
using Newtonsoft.Json.Converters;
|
2020-09-02 21:36:14 -07:00
|
|
|
|
using SabreTools.Library.Tools;
|
2020-08-23 21:10:29 -07:00
|
|
|
|
|
2020-08-21 16:48:56 -07:00
|
|
|
|
/// <summary>
|
2020-08-21 15:31:19 -07:00
|
|
|
|
/// This holds all of the auxiliary types needed for proper parsing
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
namespace SabreTools.Library.DatItems
|
|
|
|
|
|
{
|
|
|
|
|
|
#region Machine
|
|
|
|
|
|
|
|
|
|
|
|
#region ListXML
|
|
|
|
|
|
|
2020-08-22 23:40:00 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Represents one ListXML control
|
|
|
|
|
|
/// </summary>
|
2020-08-23 21:10:29 -07:00
|
|
|
|
[JsonObject("control")]
|
2020-09-01 16:21:55 -07:00
|
|
|
|
public class Control
|
2020-08-22 23:40:00 -07:00
|
|
|
|
{
|
2020-09-02 16:31:23 -07:00
|
|
|
|
#region Fields
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Control type
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("type", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-08-22 23:40:00 -07:00
|
|
|
|
public string Type { get; set; }
|
2020-08-23 21:10:29 -07:00
|
|
|
|
|
2020-09-02 16:31:23 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Player ID
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("player", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-08-22 23:40:00 -07:00
|
|
|
|
public string Player { get; set; } // TODO: Int32?
|
2020-08-23 21:10:29 -07:00
|
|
|
|
|
2020-09-02 16:31:23 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Button count
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("buttons", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-08-22 23:40:00 -07:00
|
|
|
|
public string Buttons { get; set; } // TODO: Int32?
|
2020-08-23 21:10:29 -07:00
|
|
|
|
|
2020-09-02 16:31:23 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Regular button count
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("regbuttons", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-08-22 23:40:00 -07:00
|
|
|
|
public string RegButtons { get; set; } // TODO: Int32?
|
2020-08-23 21:10:29 -07:00
|
|
|
|
|
2020-09-02 16:31:23 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Minimum value
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("minimum", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-08-22 23:40:00 -07:00
|
|
|
|
public string Minimum { get; set; } // TODO: Int32? Float?
|
2020-08-23 21:10:29 -07:00
|
|
|
|
|
2020-09-02 16:31:23 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Maximum value
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("maximum", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-08-22 23:40:00 -07:00
|
|
|
|
public string Maximum { get; set; } // TODO: Int32? Float?
|
2020-08-23 21:10:29 -07:00
|
|
|
|
|
2020-09-02 16:31:23 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Sensitivity value
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("sensitivity", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-08-22 23:40:00 -07:00
|
|
|
|
public string Sensitivity { get; set; } // TODO: Int32? Float?
|
2020-08-23 21:10:29 -07:00
|
|
|
|
|
2020-09-02 16:31:23 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Keypress delta
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("keydelta", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-08-22 23:40:00 -07:00
|
|
|
|
public string KeyDelta { get; set; } // TODO: Int32? Float?
|
2020-08-23 21:10:29 -07:00
|
|
|
|
|
2020-09-02 16:31:23 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Determines if the control is reversed
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("reverse", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-08-22 23:40:00 -07:00
|
|
|
|
public bool? Reverse { get; set; }
|
2020-08-23 21:10:29 -07:00
|
|
|
|
|
2020-09-02 16:31:23 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// First set of ways
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("ways", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-08-22 23:40:00 -07:00
|
|
|
|
public string Ways { get; set; } // TODO: Int32? Float?
|
2020-08-23 21:10:29 -07:00
|
|
|
|
|
2020-09-02 16:31:23 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Second set of ways
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("ways2", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-08-22 23:40:00 -07:00
|
|
|
|
public string Ways2 { get; set; } // TODO: Int32? Float?
|
2020-08-23 21:10:29 -07:00
|
|
|
|
|
2020-09-02 16:31:23 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Third set of ways
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("ways3", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-08-22 23:40:00 -07:00
|
|
|
|
public string Ways3 { get; set; } // TODO: Int32? Float?
|
2020-09-02 16:31:23 -07:00
|
|
|
|
|
|
|
|
|
|
#endregion
|
2020-08-22 23:40:00 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-08-23 15:34:42 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Represents one ListXML slotoption
|
|
|
|
|
|
/// </summary>
|
2020-08-23 21:10:29 -07:00
|
|
|
|
[JsonObject("slotoption")]
|
2020-09-01 16:21:55 -07:00
|
|
|
|
public class SlotOption
|
2020-08-23 15:34:42 -07:00
|
|
|
|
{
|
2020-09-02 16:31:23 -07:00
|
|
|
|
#region Fields
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Slot option name
|
|
|
|
|
|
/// </summary>
|
2020-08-23 21:10:29 -07:00
|
|
|
|
[JsonProperty("name")]
|
2020-08-23 15:34:42 -07:00
|
|
|
|
public string Name { get; set; }
|
2020-08-23 21:10:29 -07:00
|
|
|
|
|
2020-09-02 16:31:23 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Referenced device name
|
|
|
|
|
|
/// </summary>
|
2020-08-23 21:10:29 -07:00
|
|
|
|
[JsonProperty("devname")]
|
2020-08-23 15:34:42 -07:00
|
|
|
|
public string DeviceName { get; set; }
|
2020-08-23 21:10:29 -07:00
|
|
|
|
|
2020-09-02 16:31:23 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Determines if this slot option is default or not
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("default", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-08-23 15:34:42 -07:00
|
|
|
|
public bool? Default { get; set; }
|
2020-09-02 16:31:23 -07:00
|
|
|
|
|
|
|
|
|
|
#endregion
|
2020-08-23 15:34:42 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-08-22 13:31:13 -07:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
2020-08-23 15:34:42 -07:00
|
|
|
|
#region OpenMSX
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Represents the OpenMSX original value
|
|
|
|
|
|
/// </summary>
|
2020-08-23 21:10:29 -07:00
|
|
|
|
[JsonObject("original")]
|
2020-08-23 15:34:42 -07:00
|
|
|
|
public class OpenMSXOriginal
|
|
|
|
|
|
{
|
2020-08-23 21:10:29 -07:00
|
|
|
|
[JsonProperty("value")]
|
2020-08-23 15:34:42 -07:00
|
|
|
|
public bool? Value { get; set; }
|
2020-08-23 21:10:29 -07:00
|
|
|
|
|
|
|
|
|
|
[JsonProperty("content")]
|
|
|
|
|
|
public string Content { get; set; }
|
2020-08-23 15:34:42 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
2020-08-22 13:31:13 -07:00
|
|
|
|
#region SoftwareList
|
|
|
|
|
|
|
2020-08-24 22:25:47 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Represents one SoftwareList info
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonObject("info")]
|
|
|
|
|
|
public class SoftwareListInfo
|
|
|
|
|
|
{
|
|
|
|
|
|
[JsonProperty("name")]
|
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonProperty("value")]
|
|
|
|
|
|
public string Value { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-08-21 15:31:19 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Represents one SoftwareList shared feature object
|
|
|
|
|
|
/// </summary>
|
2020-08-23 21:10:29 -07:00
|
|
|
|
[JsonObject("sharedfeat")]
|
2020-08-21 15:31:19 -07:00
|
|
|
|
public class SoftwareListSharedFeature
|
|
|
|
|
|
{
|
2020-08-23 21:10:29 -07:00
|
|
|
|
[JsonProperty("name")]
|
2020-08-21 15:31:19 -07:00
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
2020-08-23 21:10:29 -07:00
|
|
|
|
[JsonProperty("value")]
|
|
|
|
|
|
public string Value { get; set; }
|
2020-08-21 15:31:19 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#endregion // Machine
|
|
|
|
|
|
|
|
|
|
|
|
#region DatItem
|
|
|
|
|
|
|
|
|
|
|
|
#region SoftwareList
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Represents one SoftwareList feature object
|
|
|
|
|
|
/// </summary>
|
2020-08-23 21:10:29 -07:00
|
|
|
|
[JsonObject("feature")]
|
2020-08-21 15:31:19 -07:00
|
|
|
|
public class SoftwareListFeature
|
|
|
|
|
|
{
|
2020-08-23 21:10:29 -07:00
|
|
|
|
[JsonProperty("name")]
|
2020-08-21 15:31:19 -07:00
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
2020-08-23 21:10:29 -07:00
|
|
|
|
[JsonProperty("value")]
|
|
|
|
|
|
public string Value { get; set; }
|
2020-08-21 15:31:19 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-08-24 22:25:47 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Represents one SoftwareList part object
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonObject("part")]
|
|
|
|
|
|
public class SoftwareListPart
|
|
|
|
|
|
{
|
|
|
|
|
|
[JsonProperty("name")]
|
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonProperty("interface")]
|
|
|
|
|
|
public string Interface { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-08-21 15:31:19 -07:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#endregion //DatItem
|
|
|
|
|
|
}
|