mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Promote Input
This commit is contained in:
@@ -161,6 +161,12 @@ namespace SabreTools.Library.DatFiles
|
|||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public long FeatureCount { get; private set; } = 0;
|
public long FeatureCount { get; private set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Number of Input items
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
|
public long InputCount { get; private set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of Media items
|
/// Number of Media items
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -593,6 +599,9 @@ namespace SabreTools.Library.DatFiles
|
|||||||
case ItemType.Feature:
|
case ItemType.Feature:
|
||||||
FeatureCount++;
|
FeatureCount++;
|
||||||
break;
|
break;
|
||||||
|
case ItemType.Input:
|
||||||
|
InputCount++;
|
||||||
|
break;
|
||||||
case ItemType.Media:
|
case ItemType.Media:
|
||||||
MediaCount++;
|
MediaCount++;
|
||||||
MD5Count += (string.IsNullOrWhiteSpace((item as Media).MD5) ? 0 : 1);
|
MD5Count += (string.IsNullOrWhiteSpace((item as Media).MD5) ? 0 : 1);
|
||||||
@@ -767,6 +776,9 @@ namespace SabreTools.Library.DatFiles
|
|||||||
case ItemType.Feature:
|
case ItemType.Feature:
|
||||||
FeatureCount--;
|
FeatureCount--;
|
||||||
break;
|
break;
|
||||||
|
case ItemType.Input:
|
||||||
|
InputCount--;
|
||||||
|
break;
|
||||||
case ItemType.Media:
|
case ItemType.Media:
|
||||||
MediaCount--;
|
MediaCount--;
|
||||||
MD5Count -= (string.IsNullOrWhiteSpace((item as Media).MD5) ? 0 : 1);
|
MD5Count -= (string.IsNullOrWhiteSpace((item as Media).MD5) ? 0 : 1);
|
||||||
|
|||||||
@@ -256,6 +256,9 @@ namespace SabreTools.Library.DatFiles
|
|||||||
case ItemType.Feature:
|
case ItemType.Feature:
|
||||||
datItem = datItemObj.ToObject<Feature>();
|
datItem = datItemObj.ToObject<Feature>();
|
||||||
break;
|
break;
|
||||||
|
case ItemType.Input:
|
||||||
|
datItem = datItemObj.ToObject<Input>();
|
||||||
|
break;
|
||||||
case ItemType.Instance:
|
case ItemType.Instance:
|
||||||
datItem = datItemObj.ToObject<Instance>();
|
datItem = datItemObj.ToObject<Instance>();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -419,6 +419,30 @@ namespace SabreTools.Library.DatFiles
|
|||||||
reader.Read();
|
reader.Read();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "input":
|
||||||
|
var input = new Input
|
||||||
|
{
|
||||||
|
Service = reader.GetAttribute("service").AsYesNo(),
|
||||||
|
Tilt = reader.GetAttribute("tilt").AsYesNo(),
|
||||||
|
Players = reader.GetAttribute("players"),
|
||||||
|
Coins = reader.GetAttribute("coins"),
|
||||||
|
|
||||||
|
Source = new Source
|
||||||
|
{
|
||||||
|
Index = indexId,
|
||||||
|
Name = filename,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Now read the internal tags
|
||||||
|
ReadInput(reader.ReadSubtree(), input);
|
||||||
|
|
||||||
|
datItems.Add(input);
|
||||||
|
|
||||||
|
// Skip the input now that we've processed it
|
||||||
|
reader.Skip();
|
||||||
|
break;
|
||||||
|
|
||||||
case "port":
|
case "port":
|
||||||
var port = new Port
|
var port = new Port
|
||||||
{
|
{
|
||||||
@@ -549,26 +573,6 @@ namespace SabreTools.Library.DatFiles
|
|||||||
reader.Read();
|
reader.Read();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "input":
|
|
||||||
var input = new Input();
|
|
||||||
input.Service = reader.GetAttribute("service").AsYesNo();
|
|
||||||
input.Tilt = reader.GetAttribute("tilt").AsYesNo();
|
|
||||||
input.Players = reader.GetAttribute("players");
|
|
||||||
input.Coins = reader.GetAttribute("coins");
|
|
||||||
|
|
||||||
// Now read the internal tags
|
|
||||||
ReadInput(reader.ReadSubtree(), input);
|
|
||||||
|
|
||||||
// Ensure the list exists
|
|
||||||
if (machine.Inputs == null)
|
|
||||||
machine.Inputs = new List<Input>();
|
|
||||||
|
|
||||||
machine.Inputs.Add(input);
|
|
||||||
|
|
||||||
// Skip the input now that we've processed it
|
|
||||||
reader.Skip();
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
reader.Read();
|
reader.Read();
|
||||||
break;
|
break;
|
||||||
@@ -1254,40 +1258,6 @@ namespace SabreTools.Library.DatFiles
|
|||||||
xtw.WriteOptionalElementString("year", datItem.Machine.Year);
|
xtw.WriteOptionalElementString("year", datItem.Machine.Year);
|
||||||
xtw.WriteOptionalElementString("manufacturer", datItem.Machine.Manufacturer);
|
xtw.WriteOptionalElementString("manufacturer", datItem.Machine.Manufacturer);
|
||||||
|
|
||||||
// TODO: These are all going away due to promotions
|
|
||||||
if (datItem.Machine.Inputs != null)
|
|
||||||
{
|
|
||||||
foreach (var input in datItem.Machine.Inputs)
|
|
||||||
{
|
|
||||||
xtw.WriteStartElement("input");
|
|
||||||
xtw.WriteOptionalAttributeString("service", input.Service.FromYesNo());
|
|
||||||
xtw.WriteOptionalAttributeString("tilt", input.Tilt.FromYesNo());
|
|
||||||
xtw.WriteOptionalAttributeString("players", input.Players);
|
|
||||||
xtw.WriteOptionalAttributeString("coins", input.Coins);
|
|
||||||
if (input.Controls != null)
|
|
||||||
{
|
|
||||||
foreach (var control in input.Controls)
|
|
||||||
{
|
|
||||||
xtw.WriteStartElement("control");
|
|
||||||
xtw.WriteOptionalAttributeString("type", control.Type);
|
|
||||||
xtw.WriteOptionalAttributeString("player", control.Player);
|
|
||||||
xtw.WriteOptionalAttributeString("buttons", control.Buttons);
|
|
||||||
xtw.WriteOptionalAttributeString("regbuttons", control.RegButtons);
|
|
||||||
xtw.WriteOptionalAttributeString("minimum", control.Minimum);
|
|
||||||
xtw.WriteOptionalAttributeString("maximum", control.Maximum);
|
|
||||||
xtw.WriteOptionalAttributeString("sensitivity", control.Sensitivity);
|
|
||||||
xtw.WriteOptionalAttributeString("keydelta", control.KeyDelta);
|
|
||||||
xtw.WriteOptionalAttributeString("reverse", control.Reverse.FromYesNo());
|
|
||||||
xtw.WriteOptionalAttributeString("ways", control.Ways);
|
|
||||||
xtw.WriteOptionalAttributeString("ways2", control.Ways2);
|
|
||||||
xtw.WriteOptionalAttributeString("ways3", control.Ways3);
|
|
||||||
xtw.WriteEndElement();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
xtw.WriteEndElement();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
xtw.Flush();
|
xtw.Flush();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -1576,6 +1546,36 @@ namespace SabreTools.Library.DatFiles
|
|||||||
xtw.WriteEndElement();
|
xtw.WriteEndElement();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ItemType.Input:
|
||||||
|
var input = datItem as Input;
|
||||||
|
xtw.WriteStartElement("input");
|
||||||
|
xtw.WriteOptionalAttributeString("service", input.Service.FromYesNo());
|
||||||
|
xtw.WriteOptionalAttributeString("tilt", input.Tilt.FromYesNo());
|
||||||
|
xtw.WriteOptionalAttributeString("players", input.Players);
|
||||||
|
xtw.WriteOptionalAttributeString("coins", input.Coins);
|
||||||
|
if (input.Controls != null)
|
||||||
|
{
|
||||||
|
foreach (var control in input.Controls)
|
||||||
|
{
|
||||||
|
xtw.WriteStartElement("control");
|
||||||
|
xtw.WriteOptionalAttributeString("type", control.Type);
|
||||||
|
xtw.WriteOptionalAttributeString("player", control.Player);
|
||||||
|
xtw.WriteOptionalAttributeString("buttons", control.Buttons);
|
||||||
|
xtw.WriteOptionalAttributeString("regbuttons", control.RegButtons);
|
||||||
|
xtw.WriteOptionalAttributeString("minimum", control.Minimum);
|
||||||
|
xtw.WriteOptionalAttributeString("maximum", control.Maximum);
|
||||||
|
xtw.WriteOptionalAttributeString("sensitivity", control.Sensitivity);
|
||||||
|
xtw.WriteOptionalAttributeString("keydelta", control.KeyDelta);
|
||||||
|
xtw.WriteOptionalAttributeString("reverse", control.Reverse.FromYesNo());
|
||||||
|
xtw.WriteOptionalAttributeString("ways", control.Ways);
|
||||||
|
xtw.WriteOptionalAttributeString("ways2", control.Ways2);
|
||||||
|
xtw.WriteOptionalAttributeString("ways3", control.Ways3);
|
||||||
|
xtw.WriteEndElement();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xtw.WriteEndElement();
|
||||||
|
break;
|
||||||
|
|
||||||
case ItemType.Port:
|
case ItemType.Port:
|
||||||
var port = datItem as Port;
|
var port = datItem as Port;
|
||||||
xtw.WriteStartElement("port");
|
xtw.WriteStartElement("port");
|
||||||
|
|||||||
@@ -1473,6 +1473,37 @@ namespace SabreTools.Library.DatFiles
|
|||||||
xtw.WriteEndElement();
|
xtw.WriteEndElement();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ItemType.Input:
|
||||||
|
var input = datItem as Input;
|
||||||
|
xtw.WriteStartElement("file");
|
||||||
|
xtw.WriteAttributeString("type", "input");
|
||||||
|
xtw.WriteOptionalAttributeString("service", input.Service.FromYesNo());
|
||||||
|
xtw.WriteOptionalAttributeString("tilt", input.Tilt.FromYesNo());
|
||||||
|
xtw.WriteOptionalAttributeString("players", input.Players);
|
||||||
|
xtw.WriteOptionalAttributeString("coins", input.Coins);
|
||||||
|
if (input.Controls != null)
|
||||||
|
{
|
||||||
|
foreach (var control in input.Controls)
|
||||||
|
{
|
||||||
|
xtw.WriteStartElement("control");
|
||||||
|
xtw.WriteOptionalAttributeString("type", control.Type);
|
||||||
|
xtw.WriteOptionalAttributeString("player", control.Player);
|
||||||
|
xtw.WriteOptionalAttributeString("buttons", control.Buttons);
|
||||||
|
xtw.WriteOptionalAttributeString("regbuttons", control.RegButtons);
|
||||||
|
xtw.WriteOptionalAttributeString("minimum", control.Minimum);
|
||||||
|
xtw.WriteOptionalAttributeString("maximum", control.Maximum);
|
||||||
|
xtw.WriteOptionalAttributeString("sensitivity", control.Sensitivity);
|
||||||
|
xtw.WriteOptionalAttributeString("keydelta", control.KeyDelta);
|
||||||
|
xtw.WriteOptionalAttributeString("reverse", control.Reverse.FromYesNo());
|
||||||
|
xtw.WriteOptionalAttributeString("ways", control.Ways);
|
||||||
|
xtw.WriteOptionalAttributeString("ways2", control.Ways2);
|
||||||
|
xtw.WriteOptionalAttributeString("ways3", control.Ways3);
|
||||||
|
xtw.WriteEndElement();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xtw.WriteEndElement();
|
||||||
|
break;
|
||||||
|
|
||||||
case ItemType.Media:
|
case ItemType.Media:
|
||||||
var media = datItem as Media;
|
var media = datItem as Media;
|
||||||
xtw.WriteStartElement("file");
|
xtw.WriteStartElement("file");
|
||||||
|
|||||||
@@ -99,48 +99,6 @@ namespace SabreTools.Library.DatItems
|
|||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Represents one ListXML input
|
|
||||||
/// </summary>
|
|
||||||
/// TODO: Promote to DatItem level (contains list)
|
|
||||||
[JsonObject("input")]
|
|
||||||
public class Input
|
|
||||||
{
|
|
||||||
#region Fields
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Input service ID
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("service", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
||||||
public bool? Service { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Determins if this has a tilt sensor
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("tilt", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
||||||
public bool? Tilt { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Number of players on the input
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("players", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
||||||
public string Players { get; set; } // TODO: Int32?
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Number of coins required
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("coins", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
||||||
public string Coins { get; set; } // TODO: Int32?
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Set of controls for the input
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("controls", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
||||||
public List<Control> Controls { get; set; }
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents one ListXML conflocation or diplocation
|
/// Represents one ListXML conflocation or diplocation
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -503,6 +503,9 @@ namespace SabreTools.Library.DatItems
|
|||||||
case ItemType.Feature:
|
case ItemType.Feature:
|
||||||
return new Feature();
|
return new Feature();
|
||||||
|
|
||||||
|
case ItemType.Input:
|
||||||
|
return new Input();
|
||||||
|
|
||||||
case ItemType.Instance:
|
case ItemType.Instance:
|
||||||
return new Instance();
|
return new Instance();
|
||||||
|
|
||||||
|
|||||||
@@ -186,28 +186,6 @@ namespace SabreTools.Library.DatItems
|
|||||||
Machine_SourceFile,
|
Machine_SourceFile,
|
||||||
Machine_Runnable,
|
Machine_Runnable,
|
||||||
|
|
||||||
// Inputs
|
|
||||||
Machine_Inputs,
|
|
||||||
Machine_Input_Service,
|
|
||||||
Machine_Input_Tilt,
|
|
||||||
Machine_Input_Players,
|
|
||||||
Machine_Input_Coins,
|
|
||||||
|
|
||||||
// Inputs.Controls
|
|
||||||
Machine_Input_Controls,
|
|
||||||
Machine_Input_Control_Type,
|
|
||||||
Machine_Input_Control_Player,
|
|
||||||
Machine_Input_Control_Buttons,
|
|
||||||
Machine_Input_Control_RegButtons,
|
|
||||||
Machine_Input_Control_Minimum,
|
|
||||||
Machine_Input_Control_Maximum,
|
|
||||||
Machine_Input_Control_Sensitivity,
|
|
||||||
Machine_Input_Control_KeyDelta,
|
|
||||||
Machine_Input_Control_Reverse,
|
|
||||||
Machine_Input_Control_Ways,
|
|
||||||
Machine_Input_Control_Ways2,
|
|
||||||
Machine_Input_Control_Ways3,
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Logiqx
|
#region Logiqx
|
||||||
@@ -418,6 +396,27 @@ namespace SabreTools.Library.DatItems
|
|||||||
DatItem_FeatureStatus,
|
DatItem_FeatureStatus,
|
||||||
DatItem_FeatureOverall,
|
DatItem_FeatureOverall,
|
||||||
|
|
||||||
|
// Inputs
|
||||||
|
DatItem_Service,
|
||||||
|
DatItem_Tilt,
|
||||||
|
DatItem_Players,
|
||||||
|
DatItem_Coins,
|
||||||
|
|
||||||
|
// Inputs.Controls
|
||||||
|
DatItem_Controls,
|
||||||
|
DatItem_Control_Type,
|
||||||
|
DatItem_Control_Player,
|
||||||
|
DatItem_Control_Buttons,
|
||||||
|
DatItem_Control_RegButtons,
|
||||||
|
DatItem_Control_Minimum,
|
||||||
|
DatItem_Control_Maximum,
|
||||||
|
DatItem_Control_Sensitivity,
|
||||||
|
DatItem_Control_KeyDelta,
|
||||||
|
DatItem_Control_Reverse,
|
||||||
|
DatItem_Control_Ways,
|
||||||
|
DatItem_Control_Ways2,
|
||||||
|
DatItem_Control_Ways3,
|
||||||
|
|
||||||
// Port.Analogs
|
// Port.Analogs
|
||||||
DatItem_Analogs,
|
DatItem_Analogs,
|
||||||
DatItem_Analog_Mask,
|
DatItem_Analog_Mask,
|
||||||
@@ -491,6 +490,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
Driver,
|
Driver,
|
||||||
Extension,
|
Extension,
|
||||||
Feature,
|
Feature,
|
||||||
|
Input,
|
||||||
Instance,
|
Instance,
|
||||||
Port,
|
Port,
|
||||||
RamOption,
|
RamOption,
|
||||||
|
|||||||
264
SabreTools.Library/DatItems/Input.cs
Normal file
264
SabreTools.Library/DatItems/Input.cs
Normal file
@@ -0,0 +1,264 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using SabreTools.Library.Filtering;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using SabreTools.Library.Tools;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This holds all of the auxiliary types needed for proper parsing
|
||||||
|
/// </summary>
|
||||||
|
namespace SabreTools.Library.DatItems
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents one ListXML input
|
||||||
|
/// </summary>
|
||||||
|
[JsonObject("input")]
|
||||||
|
public class Input : DatItem
|
||||||
|
{
|
||||||
|
#region Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Input service ID
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("service", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
public bool? Service { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determins if this has a tilt sensor
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("tilt", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
public bool? Tilt { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Number of players on the input
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("players", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
public string Players { get; set; } // TODO: Int32?
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Number of coins required
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("coins", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
public string Coins { get; set; } // TODO: Int32?
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set of controls for the input
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("controls", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
public List<Control> Controls { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Accessors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set fields with given values
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mappings">Mappings dictionary</param>
|
||||||
|
public override void SetFields(Dictionary<Field, string> mappings)
|
||||||
|
{
|
||||||
|
// Set base fields
|
||||||
|
base.SetFields(mappings);
|
||||||
|
|
||||||
|
// Handle Input-specific fields
|
||||||
|
if (mappings.Keys.Contains(Field.DatItem_Service))
|
||||||
|
Service = mappings[Field.DatItem_Service].AsYesNo();
|
||||||
|
|
||||||
|
if (mappings.Keys.Contains(Field.DatItem_Tilt))
|
||||||
|
Tilt = mappings[Field.DatItem_Tilt].AsYesNo();
|
||||||
|
|
||||||
|
if (mappings.Keys.Contains(Field.DatItem_Players))
|
||||||
|
Players = mappings[Field.DatItem_Players];
|
||||||
|
|
||||||
|
if (mappings.Keys.Contains(Field.DatItem_Coins))
|
||||||
|
Coins = mappings[Field.DatItem_Coins];
|
||||||
|
|
||||||
|
// TODO: Handle DatItem_Control*
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a default, empty Input object
|
||||||
|
/// </summary>
|
||||||
|
public Input()
|
||||||
|
{
|
||||||
|
ItemType = ItemType.Input;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Cloning Methods
|
||||||
|
|
||||||
|
public override object Clone()
|
||||||
|
{
|
||||||
|
return new Input()
|
||||||
|
{
|
||||||
|
ItemType = this.ItemType,
|
||||||
|
DupeType = this.DupeType,
|
||||||
|
|
||||||
|
AltName = this.AltName,
|
||||||
|
AltTitle = this.AltTitle,
|
||||||
|
|
||||||
|
Original = this.Original,
|
||||||
|
OpenMSXSubType = this.OpenMSXSubType,
|
||||||
|
OpenMSXType = this.OpenMSXType,
|
||||||
|
Remark = this.Remark,
|
||||||
|
Boot = this.Boot,
|
||||||
|
|
||||||
|
Part = this.Part,
|
||||||
|
Features = this.Features,
|
||||||
|
AreaName = this.AreaName,
|
||||||
|
AreaSize = this.AreaSize,
|
||||||
|
AreaWidth = this.AreaWidth,
|
||||||
|
AreaEndianness = this.AreaEndianness,
|
||||||
|
Value = this.Value,
|
||||||
|
LoadFlag = this.LoadFlag,
|
||||||
|
|
||||||
|
Machine = this.Machine.Clone() as Machine,
|
||||||
|
Source = this.Source.Clone() as Source,
|
||||||
|
Remove = this.Remove,
|
||||||
|
|
||||||
|
Service = this.Service,
|
||||||
|
Tilt = this.Tilt,
|
||||||
|
Players = this.Players,
|
||||||
|
Coins = this.Coins,
|
||||||
|
Controls = this.Controls,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Comparision Methods
|
||||||
|
|
||||||
|
public override bool Equals(DatItem other)
|
||||||
|
{
|
||||||
|
// If we don't have a Input, return false
|
||||||
|
if (ItemType != other.ItemType)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Otherwise, treat it as a Input
|
||||||
|
Input newOther = other as Input;
|
||||||
|
|
||||||
|
// If the Input information matches
|
||||||
|
return (Service == newOther.Service
|
||||||
|
&& Tilt == newOther.Tilt
|
||||||
|
&& Players == newOther.Players
|
||||||
|
&& Coins == newOther.Coins);
|
||||||
|
|
||||||
|
// TODO: Handle DatItem_Control*
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Filtering
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check to see if a DatItem passes the filter
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="filter">Filter to check against</param>
|
||||||
|
/// <returns>True if the item passed the filter, false otherwise</returns>
|
||||||
|
public override bool PassesFilter(Filter filter)
|
||||||
|
{
|
||||||
|
// Check common fields first
|
||||||
|
if (!base.PassesFilter(filter))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Filter on service
|
||||||
|
if (filter.DatItem_Service.MatchesNeutral(null, Service) == false)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Filter on tilt
|
||||||
|
if (filter.DatItem_Tilt.MatchesNeutral(null, Tilt) == false)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Filter on players
|
||||||
|
if (filter.DatItem_Players.MatchesPositiveSet(Players) == false)
|
||||||
|
return false;
|
||||||
|
if (filter.DatItem_Players.MatchesNegativeSet(Players) == true)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Filter on coins
|
||||||
|
if (filter.DatItem_Coins.MatchesPositiveSet(Coins) == false)
|
||||||
|
return false;
|
||||||
|
if (filter.DatItem_Coins.MatchesNegativeSet(Coins) == true)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// TODO: Handle DatItem_Control*
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remove fields from the DatItem
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fields">List of Fields to remove</param>
|
||||||
|
public override void RemoveFields(List<Field> fields)
|
||||||
|
{
|
||||||
|
// Remove common fields first
|
||||||
|
base.RemoveFields(fields);
|
||||||
|
|
||||||
|
// Remove the fields
|
||||||
|
if (fields.Contains(Field.DatItem_Service))
|
||||||
|
Service = null;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_Tilt))
|
||||||
|
Tilt = null;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_Players))
|
||||||
|
Players = null;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_Coins))
|
||||||
|
Coins = null;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_Controls))
|
||||||
|
Controls = null;
|
||||||
|
|
||||||
|
// TODO: Handle DatItem_Control*
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Sorting and Merging
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replace fields from another item
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item">DatItem to pull new information from</param>
|
||||||
|
/// <param name="fields">List of Fields representing what should be updated</param>
|
||||||
|
public override void ReplaceFields(DatItem item, List<Field> fields)
|
||||||
|
{
|
||||||
|
// Replace common fields first
|
||||||
|
base.ReplaceFields(item, fields);
|
||||||
|
|
||||||
|
// If we don't have a Input to replace from, ignore specific fields
|
||||||
|
if (item.ItemType != ItemType.Input)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Cast for easier access
|
||||||
|
Input newItem = item as Input;
|
||||||
|
|
||||||
|
// Replace the fields
|
||||||
|
if (fields.Contains(Field.DatItem_Service))
|
||||||
|
Service = newItem.Service;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_Tilt))
|
||||||
|
Tilt = newItem.Tilt;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_Players))
|
||||||
|
Players = newItem.Players;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_Coins))
|
||||||
|
Coins = newItem.Coins;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_Controls))
|
||||||
|
Controls = newItem.Controls;
|
||||||
|
|
||||||
|
// TODO: Handle DatItem_Control*
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -152,12 +152,6 @@ namespace SabreTools.Library.DatItems
|
|||||||
[JsonProperty("runnable", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("runnable", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
public Runnable Runnable { get; set; } = Runnable.NULL;
|
public Runnable Runnable { get; set; } = Runnable.NULL;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// List of associated inputs
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("inputs", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
||||||
public List<Input> Inputs { get; set; } = null;
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Logiqx Fields
|
#region Logiqx Fields
|
||||||
@@ -493,7 +487,6 @@ namespace SabreTools.Library.DatItems
|
|||||||
|
|
||||||
SourceFile = this.SourceFile,
|
SourceFile = this.SourceFile,
|
||||||
Runnable = this.Runnable,
|
Runnable = this.Runnable,
|
||||||
Inputs = this.Inputs,
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
@@ -50,28 +50,6 @@ namespace SabreTools.Library.Filtering
|
|||||||
|
|
||||||
public FilterItem<string> Machine_SourceFile { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> Machine_SourceFile { get; private set; } = new FilterItem<string>();
|
||||||
public FilterItem<Runnable> Machine_Runnable { get; private set; } = new FilterItem<Runnable>() { Positive = Runnable.NULL, Negative = Runnable.NULL };
|
public FilterItem<Runnable> Machine_Runnable { get; private set; } = new FilterItem<Runnable>() { Positive = Runnable.NULL, Negative = Runnable.NULL };
|
||||||
|
|
||||||
// Inputs
|
|
||||||
public FilterItem<bool?> Machine_Inputs { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
|
||||||
public FilterItem<bool?> Machine_Input_Service { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
|
||||||
public FilterItem<bool?> Machine_Input_Tilt { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
|
||||||
public FilterItem<string> Machine_Input_Players { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<string> Machine_Input_Coins { get; private set; } = new FilterItem<string>();
|
|
||||||
|
|
||||||
// Inputs.Controls
|
|
||||||
public FilterItem<bool?> Machine_Input_Controls { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
|
||||||
public FilterItem<string> Machine_Input_Control_Type { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<string> Machine_Input_Control_Player { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<string> Machine_Input_Control_Buttons { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<string> Machine_Input_Control_RegButtons { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<string> Machine_Input_Control_Minimum { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<string> Machine_Input_Control_Maximum { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<string> Machine_Input_Control_Sensitivity { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<string> Machine_Input_Control_KeyDelta { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<bool?> Machine_Input_Control_Reverse { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
|
||||||
public FilterItem<string> Machine_Input_Control_Ways { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<string> Machine_Input_Control_Ways2 { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<string> Machine_Input_Control_Ways3 { get; private set; } = new FilterItem<string>();
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -283,6 +261,27 @@ namespace SabreTools.Library.Filtering
|
|||||||
public FilterItem<FeatureStatus> DatItem_FeatureStatus { get; private set; } = new FilterItem<FeatureStatus>() { Positive = FeatureStatus.NULL, Negative = FeatureStatus.NULL };
|
public FilterItem<FeatureStatus> DatItem_FeatureStatus { get; private set; } = new FilterItem<FeatureStatus>() { Positive = FeatureStatus.NULL, Negative = FeatureStatus.NULL };
|
||||||
public FilterItem<FeatureStatus> DatItem_FeatureOverall { get; private set; } = new FilterItem<FeatureStatus>() { Positive = FeatureStatus.NULL, Negative = FeatureStatus.NULL };
|
public FilterItem<FeatureStatus> DatItem_FeatureOverall { get; private set; } = new FilterItem<FeatureStatus>() { Positive = FeatureStatus.NULL, Negative = FeatureStatus.NULL };
|
||||||
|
|
||||||
|
// Input
|
||||||
|
public FilterItem<bool?> DatItem_Service { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||||
|
public FilterItem<bool?> DatItem_Tilt { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||||
|
public FilterItem<string> DatItem_Players { get; private set; } = new FilterItem<string>();
|
||||||
|
public FilterItem<string> DatItem_Coins { get; private set; } = new FilterItem<string>();
|
||||||
|
|
||||||
|
// Input.Controls
|
||||||
|
public FilterItem<bool?> DatItem_Controls { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||||
|
public FilterItem<string> DatItem_Control_Type { get; private set; } = new FilterItem<string>();
|
||||||
|
public FilterItem<string> DatItem_Control_Player { get; private set; } = new FilterItem<string>();
|
||||||
|
public FilterItem<string> DatItem_Control_Buttons { get; private set; } = new FilterItem<string>();
|
||||||
|
public FilterItem<string> DatItem_Control_RegButtons { get; private set; } = new FilterItem<string>();
|
||||||
|
public FilterItem<string> DatItem_Control_Minimum { get; private set; } = new FilterItem<string>();
|
||||||
|
public FilterItem<string> DatItem_Control_Maximum { get; private set; } = new FilterItem<string>();
|
||||||
|
public FilterItem<string> DatItem_Control_Sensitivity { get; private set; } = new FilterItem<string>();
|
||||||
|
public FilterItem<string> DatItem_Control_KeyDelta { get; private set; } = new FilterItem<string>();
|
||||||
|
public FilterItem<bool?> DatItem_Control_Reverse { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||||
|
public FilterItem<string> DatItem_Control_Ways { get; private set; } = new FilterItem<string>();
|
||||||
|
public FilterItem<string> DatItem_Control_Ways2 { get; private set; } = new FilterItem<string>();
|
||||||
|
public FilterItem<string> DatItem_Control_Ways3 { get; private set; } = new FilterItem<string>();
|
||||||
|
|
||||||
// Port.Analogs
|
// Port.Analogs
|
||||||
public FilterItem<bool?> DatItem_Analogs { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
public FilterItem<bool?> DatItem_Analogs { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||||
public FilterItem<string> DatItem_Analog_Mask { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> DatItem_Analog_Mask { get; private set; } = new FilterItem<string>();
|
||||||
@@ -531,151 +530,7 @@ namespace SabreTools.Library.Filtering
|
|||||||
Machine_Runnable.Negative |= value.AsRunnable();
|
Machine_Runnable.Negative |= value.AsRunnable();
|
||||||
else
|
else
|
||||||
Machine_Runnable.Positive |= value.AsRunnable();
|
Machine_Runnable.Positive |= value.AsRunnable();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Inputs
|
|
||||||
case Field.Machine_Inputs:
|
|
||||||
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
|
||||||
Machine_Inputs.Neutral = false;
|
|
||||||
else
|
|
||||||
Machine_Inputs.Neutral = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Input_Service:
|
|
||||||
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
|
||||||
Machine_Input_Service.Neutral = false;
|
|
||||||
else
|
|
||||||
Machine_Input_Service.Neutral = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Input_Tilt:
|
|
||||||
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
|
||||||
Machine_Input_Tilt.Neutral = false;
|
|
||||||
else
|
|
||||||
Machine_Input_Tilt.Neutral = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Input_Players:
|
|
||||||
if (negate)
|
|
||||||
Machine_Input_Players.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Input_Players.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Input_Coins:
|
|
||||||
if (negate)
|
|
||||||
Machine_Input_Coins.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Input_Coins.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Inputs.Controls
|
|
||||||
case Field.Machine_Input_Controls:
|
|
||||||
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
|
||||||
Machine_Input_Controls.Neutral = false;
|
|
||||||
else
|
|
||||||
Machine_Input_Controls.Neutral = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Input_Control_Type:
|
|
||||||
if (negate)
|
|
||||||
Machine_Input_Control_Type.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Input_Control_Type.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Input_Control_Player:
|
|
||||||
if (negate)
|
|
||||||
Machine_Input_Control_Player.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Input_Control_Player.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Input_Control_Buttons:
|
|
||||||
if (negate)
|
|
||||||
Machine_Input_Control_Buttons.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Input_Control_Buttons.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Input_Control_RegButtons:
|
|
||||||
if (negate)
|
|
||||||
Machine_Input_Control_RegButtons.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Input_Control_RegButtons.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Input_Control_Minimum:
|
|
||||||
if (negate)
|
|
||||||
Machine_Input_Control_Minimum.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Input_Control_Minimum.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Input_Control_Maximum:
|
|
||||||
if (negate)
|
|
||||||
Machine_Input_Control_Maximum.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Input_Control_Maximum.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Input_Control_Sensitivity:
|
|
||||||
if (negate)
|
|
||||||
Machine_Input_Control_Sensitivity.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Input_Control_Sensitivity.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Input_Control_KeyDelta:
|
|
||||||
if (negate)
|
|
||||||
Machine_Input_Control_KeyDelta.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Input_Control_KeyDelta.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Input_Control_Reverse:
|
|
||||||
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
|
||||||
Machine_Input_Control_Reverse.Neutral = false;
|
|
||||||
else
|
|
||||||
Machine_Input_Control_Reverse.Neutral = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Input_Control_Ways:
|
|
||||||
if (negate)
|
|
||||||
Machine_Input_Control_Ways.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Input_Control_Ways.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Input_Control_Ways2:
|
|
||||||
if (negate)
|
|
||||||
Machine_Input_Control_Ways2.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Input_Control_Ways2.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Input_Control_Ways3:
|
|
||||||
if (negate)
|
|
||||||
Machine_Input_Control_Ways3.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Input_Control_Ways3.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
|
||||||
// Ports.Analogs
|
|
||||||
case Field.DatItem_Analogs:
|
|
||||||
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
|
||||||
DatItem_Analogs.Neutral = false;
|
|
||||||
else
|
|
||||||
DatItem_Analogs.Neutral = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.DatItem_Analog_Mask:
|
|
||||||
if (negate)
|
|
||||||
DatItem_Analog_Mask.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
DatItem_Analog_Mask.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -1636,6 +1491,142 @@ namespace SabreTools.Library.Filtering
|
|||||||
DatItem_FeatureOverall.Positive |= value.AsFeatureStatus();
|
DatItem_FeatureOverall.Positive |= value.AsFeatureStatus();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Input
|
||||||
|
case Field.DatItem_Service:
|
||||||
|
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
||||||
|
DatItem_Service.Neutral = false;
|
||||||
|
else
|
||||||
|
DatItem_Service.Neutral = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Tilt:
|
||||||
|
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
||||||
|
DatItem_Tilt.Neutral = false;
|
||||||
|
else
|
||||||
|
DatItem_Tilt.Neutral = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Players:
|
||||||
|
if (negate)
|
||||||
|
DatItem_Players.NegativeSet.Add(value);
|
||||||
|
else
|
||||||
|
DatItem_Players.PositiveSet.Add(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Coins:
|
||||||
|
if (negate)
|
||||||
|
DatItem_Coins.NegativeSet.Add(value);
|
||||||
|
else
|
||||||
|
DatItem_Coins.PositiveSet.Add(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
// Input.Controls
|
||||||
|
case Field.DatItem_Controls:
|
||||||
|
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
||||||
|
DatItem_Controls.Neutral = false;
|
||||||
|
else
|
||||||
|
DatItem_Controls.Neutral = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Control_Type:
|
||||||
|
if (negate)
|
||||||
|
DatItem_Control_Type.NegativeSet.Add(value);
|
||||||
|
else
|
||||||
|
DatItem_Control_Type.PositiveSet.Add(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Control_Player:
|
||||||
|
if (negate)
|
||||||
|
DatItem_Control_Player.NegativeSet.Add(value);
|
||||||
|
else
|
||||||
|
DatItem_Control_Player.PositiveSet.Add(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Control_Buttons:
|
||||||
|
if (negate)
|
||||||
|
DatItem_Control_Buttons.NegativeSet.Add(value);
|
||||||
|
else
|
||||||
|
DatItem_Control_Buttons.PositiveSet.Add(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Control_RegButtons:
|
||||||
|
if (negate)
|
||||||
|
DatItem_Control_RegButtons.NegativeSet.Add(value);
|
||||||
|
else
|
||||||
|
DatItem_Control_RegButtons.PositiveSet.Add(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Control_Minimum:
|
||||||
|
if (negate)
|
||||||
|
DatItem_Control_Minimum.NegativeSet.Add(value);
|
||||||
|
else
|
||||||
|
DatItem_Control_Minimum.PositiveSet.Add(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Control_Maximum:
|
||||||
|
if (negate)
|
||||||
|
DatItem_Control_Maximum.NegativeSet.Add(value);
|
||||||
|
else
|
||||||
|
DatItem_Control_Maximum.PositiveSet.Add(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Control_Sensitivity:
|
||||||
|
if (negate)
|
||||||
|
DatItem_Control_Sensitivity.NegativeSet.Add(value);
|
||||||
|
else
|
||||||
|
DatItem_Control_Sensitivity.PositiveSet.Add(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Control_KeyDelta:
|
||||||
|
if (negate)
|
||||||
|
DatItem_Control_KeyDelta.NegativeSet.Add(value);
|
||||||
|
else
|
||||||
|
DatItem_Control_KeyDelta.PositiveSet.Add(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Control_Reverse:
|
||||||
|
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
||||||
|
DatItem_Control_Reverse.Neutral = false;
|
||||||
|
else
|
||||||
|
DatItem_Control_Reverse.Neutral = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Control_Ways:
|
||||||
|
if (negate)
|
||||||
|
DatItem_Control_Ways.NegativeSet.Add(value);
|
||||||
|
else
|
||||||
|
DatItem_Control_Ways.PositiveSet.Add(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Control_Ways2:
|
||||||
|
if (negate)
|
||||||
|
DatItem_Control_Ways2.NegativeSet.Add(value);
|
||||||
|
else
|
||||||
|
DatItem_Control_Ways2.PositiveSet.Add(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Control_Ways3:
|
||||||
|
if (negate)
|
||||||
|
DatItem_Control_Ways3.NegativeSet.Add(value);
|
||||||
|
else
|
||||||
|
DatItem_Control_Ways3.PositiveSet.Add(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
// Port.Analogs
|
||||||
|
case Field.DatItem_Analogs:
|
||||||
|
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
||||||
|
DatItem_Analogs.Neutral = false;
|
||||||
|
else
|
||||||
|
DatItem_Analogs.Neutral = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Analog_Mask:
|
||||||
|
if (negate)
|
||||||
|
DatItem_Analog_Mask.NegativeSet.Add(value);
|
||||||
|
else
|
||||||
|
DatItem_Analog_Mask.PositiveSet.Add(value);
|
||||||
|
break;
|
||||||
|
|
||||||
// Ram Option
|
// Ram Option
|
||||||
case Field.DatItem_Content:
|
case Field.DatItem_Content:
|
||||||
if (negate)
|
if (negate)
|
||||||
|
|||||||
@@ -570,61 +570,7 @@ namespace SabreTools.Library.Tools
|
|||||||
return Field.Machine_SourceFile;
|
return Field.Machine_SourceFile;
|
||||||
|
|
||||||
case "runnable":
|
case "runnable":
|
||||||
return Field.Machine_Runnable;
|
return Field.Machine_Runnable;
|
||||||
|
|
||||||
case "inputs":
|
|
||||||
return Field.Machine_Inputs;
|
|
||||||
|
|
||||||
case "input_service":
|
|
||||||
return Field.Machine_Input_Service;
|
|
||||||
|
|
||||||
case "input_tilt":
|
|
||||||
return Field.Machine_Input_Tilt;
|
|
||||||
|
|
||||||
case "input_players":
|
|
||||||
return Field.Machine_Input_Players;
|
|
||||||
|
|
||||||
case "input_coins":
|
|
||||||
return Field.Machine_Input_Coins;
|
|
||||||
|
|
||||||
case "input_controls":
|
|
||||||
return Field.Machine_Input_Controls;
|
|
||||||
|
|
||||||
case "input_control_type":
|
|
||||||
return Field.Machine_Input_Control_Type;
|
|
||||||
|
|
||||||
case "input_control_player":
|
|
||||||
return Field.Machine_Input_Control_Player;
|
|
||||||
|
|
||||||
case "input_control_buttons":
|
|
||||||
return Field.Machine_Input_Control_Buttons;
|
|
||||||
|
|
||||||
case "input_control_regbuttons":
|
|
||||||
return Field.Machine_Input_Control_RegButtons;
|
|
||||||
|
|
||||||
case "input_control_minimum":
|
|
||||||
return Field.Machine_Input_Control_Minimum;
|
|
||||||
|
|
||||||
case "input_control_maximum":
|
|
||||||
return Field.Machine_Input_Control_Maximum;
|
|
||||||
|
|
||||||
case "input_control_sensitivity":
|
|
||||||
return Field.Machine_Input_Control_Sensitivity;
|
|
||||||
|
|
||||||
case "input_control_keydelta":
|
|
||||||
return Field.Machine_Input_Control_KeyDelta;
|
|
||||||
|
|
||||||
case "input_control_reverse":
|
|
||||||
return Field.Machine_Input_Control_Reverse;
|
|
||||||
|
|
||||||
case "input_control_ways":
|
|
||||||
return Field.Machine_Input_Control_Ways;
|
|
||||||
|
|
||||||
case "input_control_ways2":
|
|
||||||
return Field.Machine_Input_Control_Ways2;
|
|
||||||
|
|
||||||
case "input_control_ways3":
|
|
||||||
return Field.Machine_Input_Control_Ways3;
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -1098,6 +1044,58 @@ namespace SabreTools.Library.Tools
|
|||||||
case "featureoverall":
|
case "featureoverall":
|
||||||
return Field.DatItem_FeatureOverall;
|
return Field.DatItem_FeatureOverall;
|
||||||
|
|
||||||
|
// Input
|
||||||
|
case "service":
|
||||||
|
return Field.DatItem_Service;
|
||||||
|
|
||||||
|
case "tilt":
|
||||||
|
return Field.DatItem_Tilt;
|
||||||
|
|
||||||
|
case "players":
|
||||||
|
return Field.DatItem_Players;
|
||||||
|
|
||||||
|
case "coins":
|
||||||
|
return Field.DatItem_Coins;
|
||||||
|
|
||||||
|
case "controls":
|
||||||
|
return Field.DatItem_Controls;
|
||||||
|
|
||||||
|
case "control_type":
|
||||||
|
return Field.DatItem_Control_Type;
|
||||||
|
|
||||||
|
case "control_player":
|
||||||
|
return Field.DatItem_Control_Player;
|
||||||
|
|
||||||
|
case "control_buttons":
|
||||||
|
return Field.DatItem_Control_Buttons;
|
||||||
|
|
||||||
|
case "control_regbuttons":
|
||||||
|
return Field.DatItem_Control_RegButtons;
|
||||||
|
|
||||||
|
case "control_minimum":
|
||||||
|
return Field.DatItem_Control_Minimum;
|
||||||
|
|
||||||
|
case "control_maximum":
|
||||||
|
return Field.DatItem_Control_Maximum;
|
||||||
|
|
||||||
|
case "control_sensitivity":
|
||||||
|
return Field.DatItem_Control_Sensitivity;
|
||||||
|
|
||||||
|
case "control_keydelta":
|
||||||
|
return Field.DatItem_Control_KeyDelta;
|
||||||
|
|
||||||
|
case "control_reverse":
|
||||||
|
return Field.DatItem_Control_Reverse;
|
||||||
|
|
||||||
|
case "control_ways":
|
||||||
|
return Field.DatItem_Control_Ways;
|
||||||
|
|
||||||
|
case "control_ways2":
|
||||||
|
return Field.DatItem_Control_Ways2;
|
||||||
|
|
||||||
|
case "control_ways3":
|
||||||
|
return Field.DatItem_Control_Ways3;
|
||||||
|
|
||||||
// Port
|
// Port
|
||||||
case "analogs":
|
case "analogs":
|
||||||
return Field.DatItem_Analogs;
|
return Field.DatItem_Analogs;
|
||||||
@@ -1673,6 +1671,8 @@ namespace SabreTools.Library.Tools
|
|||||||
return ItemType.Extension;
|
return ItemType.Extension;
|
||||||
case "feature":
|
case "feature":
|
||||||
return ItemType.Feature;
|
return ItemType.Feature;
|
||||||
|
case "input":
|
||||||
|
return ItemType.Input;
|
||||||
case "instance":
|
case "instance":
|
||||||
return ItemType.Instance;
|
return ItemType.Instance;
|
||||||
case "media":
|
case "media":
|
||||||
@@ -1715,6 +1715,7 @@ namespace SabreTools.Library.Tools
|
|||||||
"driver" => ItemType.Driver,
|
"driver" => ItemType.Driver,
|
||||||
"extension" => ItemType.Extension,
|
"extension" => ItemType.Extension,
|
||||||
"feature" => ItemType.Feature,
|
"feature" => ItemType.Feature,
|
||||||
|
"input" => ItemType.Input,
|
||||||
"instance" => ItemType.Instance,
|
"instance" => ItemType.Instance,
|
||||||
"media" => ItemType.Media,
|
"media" => ItemType.Media,
|
||||||
"port" => ItemType.Port,
|
"port" => ItemType.Port,
|
||||||
@@ -2299,6 +2300,8 @@ namespace SabreTools.Library.Tools
|
|||||||
return "extension";
|
return "extension";
|
||||||
case ItemType.Feature:
|
case ItemType.Feature:
|
||||||
return "feature";
|
return "feature";
|
||||||
|
case ItemType.Input:
|
||||||
|
return "input";
|
||||||
case ItemType.Instance:
|
case ItemType.Instance:
|
||||||
return "instance";
|
return "instance";
|
||||||
case ItemType.Media:
|
case ItemType.Media:
|
||||||
@@ -2341,6 +2344,7 @@ namespace SabreTools.Library.Tools
|
|||||||
ItemType.Driver => "driver",
|
ItemType.Driver => "driver",
|
||||||
ItemType.Extension => "extension",
|
ItemType.Extension => "extension",
|
||||||
ItemType.Feature => "feature",
|
ItemType.Feature => "feature",
|
||||||
|
ItemType.Input => "input",
|
||||||
ItemType.Instance => "instance",
|
ItemType.Instance => "instance",
|
||||||
ItemType.Media => "media",
|
ItemType.Media => "media",
|
||||||
ItemType.Port => "port",
|
ItemType.Port => "port",
|
||||||
|
|||||||
Reference in New Issue
Block a user