2020-09-04 11:46:17 -07:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
2020-09-02 23:02:06 -07:00
|
|
|
|
using System.Linq;
|
2020-09-07 22:00:02 -07:00
|
|
|
|
using System.Xml.Serialization;
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-12-08 13:23:59 -08:00
|
|
|
|
using SabreTools.Core;
|
2020-12-08 16:37:08 -08:00
|
|
|
|
using SabreTools.Core.Tools;
|
2020-09-02 23:02:06 -07:00
|
|
|
|
using Newtonsoft.Json;
|
2020-09-07 22:00:02 -07:00
|
|
|
|
using Newtonsoft.Json.Converters;
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-12-08 15:15:41 -08:00
|
|
|
|
namespace SabreTools.DatItems
|
2020-09-02 23:02:06 -07:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Represents control for an input
|
|
|
|
|
|
/// </summary>
|
2020-09-08 10:12:41 -07:00
|
|
|
|
[JsonObject("control"), XmlRoot("control")]
|
2020-09-02 23:02:06 -07:00
|
|
|
|
public class Control : DatItem
|
|
|
|
|
|
{
|
|
|
|
|
|
#region Fields
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2020-09-06 23:00:13 -07:00
|
|
|
|
/// General type of input
|
2020-09-02 23:02:06 -07:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("type", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[JsonConverter(typeof(StringEnumConverter))]
|
|
|
|
|
|
[XmlElement("type")]
|
2020-09-06 23:00:13 -07:00
|
|
|
|
public ControlType ControlType { get; set; }
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
public bool ControlTypeSpecified { get { return ControlType != ControlType.NULL; } }
|
|
|
|
|
|
|
2020-09-02 23:02:06 -07:00
|
|
|
|
/// <summary>
|
2020-09-06 23:00:13 -07:00
|
|
|
|
/// Player which the input belongs to
|
2020-09-02 23:02:06 -07:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("player", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[XmlElement("player")]
|
2020-09-04 11:46:17 -07:00
|
|
|
|
public long? Player { get; set; }
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
public bool PlayerSpecified { get { return Player != null; } }
|
|
|
|
|
|
|
2020-09-02 23:02:06 -07:00
|
|
|
|
/// <summary>
|
2020-09-06 23:00:13 -07:00
|
|
|
|
/// Total number of buttons
|
2020-09-02 23:02:06 -07:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("buttons", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[XmlElement("buttons")]
|
2020-09-04 11:46:17 -07:00
|
|
|
|
public long? Buttons { get; set; }
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
public bool ButtonsSpecified { get { return Buttons != null; } }
|
|
|
|
|
|
|
2020-09-02 23:02:06 -07:00
|
|
|
|
/// <summary>
|
2020-09-06 23:00:13 -07:00
|
|
|
|
/// Total number of non-optional buttons
|
2020-09-02 23:02:06 -07:00
|
|
|
|
/// </summary>
|
2020-09-06 23:00:13 -07:00
|
|
|
|
[JsonProperty("reqbuttons", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[XmlElement("reqbuttons")]
|
2020-09-06 23:00:13 -07:00
|
|
|
|
public long? RequiredButtons { get; set; }
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
public bool RequiredButtonsSpecified { get { return RequiredButtons != null; } }
|
|
|
|
|
|
|
2020-09-02 23:02:06 -07:00
|
|
|
|
/// <summary>
|
2020-09-06 23:00:13 -07:00
|
|
|
|
/// Analog minimum value
|
2020-09-02 23:02:06 -07:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("minimum", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[XmlElement("minimum")]
|
2020-09-04 11:46:17 -07:00
|
|
|
|
public long? Minimum { get; set; }
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
public bool MinimumSpecified { get { return Minimum != null; } }
|
|
|
|
|
|
|
2020-09-02 23:02:06 -07:00
|
|
|
|
/// <summary>
|
2020-09-06 23:00:13 -07:00
|
|
|
|
/// Analog maximum value
|
2020-09-02 23:02:06 -07:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("maximum", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[XmlElement("maximum")]
|
2020-09-04 11:46:17 -07:00
|
|
|
|
public long? Maximum { get; set; }
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
public bool MaximumSpecified { get { return Maximum != null; } }
|
|
|
|
|
|
|
2020-09-02 23:02:06 -07:00
|
|
|
|
/// <summary>
|
2020-09-06 23:00:13 -07:00
|
|
|
|
/// Default analog sensitivity
|
2020-09-02 23:02:06 -07:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("sensitivity", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[XmlElement("sensitivity")]
|
2020-09-04 11:46:17 -07:00
|
|
|
|
public long? Sensitivity { get; set; }
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
public bool SensitivitySpecified { get { return Sensitivity != null; } }
|
|
|
|
|
|
|
2020-09-02 23:02:06 -07:00
|
|
|
|
/// <summary>
|
2020-09-06 23:00:13 -07:00
|
|
|
|
/// Default analog keydelta
|
2020-09-02 23:02:06 -07:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("keydelta", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[XmlElement("keydelta")]
|
2020-09-04 11:46:17 -07:00
|
|
|
|
public long? KeyDelta { get; set; }
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
public bool KeyDeltaSpecified { get { return KeyDelta != null; } }
|
|
|
|
|
|
|
2020-09-02 23:02:06 -07:00
|
|
|
|
/// <summary>
|
2020-09-06 23:00:13 -07:00
|
|
|
|
/// Default analog reverse setting
|
2020-09-02 23:02:06 -07:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("reverse", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 22:19:37 -07:00
|
|
|
|
[XmlElement("reverse")]
|
2020-09-02 23:02:06 -07:00
|
|
|
|
public bool? Reverse { get; set; }
|
|
|
|
|
|
|
2020-09-07 22:00:02 -07:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
public bool ReverseSpecified { get { return Reverse != null; } }
|
|
|
|
|
|
|
2020-09-02 23:02:06 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// First set of ways
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("ways", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 22:19:37 -07:00
|
|
|
|
[XmlElement("ways")]
|
2020-09-04 11:46:17 -07:00
|
|
|
|
public string Ways { get; set; }
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Second set of ways
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("ways2", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 22:19:37 -07:00
|
|
|
|
[XmlElement("ways2")]
|
2020-09-04 11:46:17 -07:00
|
|
|
|
public string Ways2 { get; set; }
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Third set of ways
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[JsonProperty("ways3", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
2020-09-07 22:19:37 -07:00
|
|
|
|
[XmlElement("ways3")]
|
2020-09-04 11:46:17 -07:00
|
|
|
|
public string Ways3 { get; set; }
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Accessors
|
|
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public override void SetFields(
|
|
|
|
|
|
Dictionary<DatItemField, string> datItemMappings,
|
|
|
|
|
|
Dictionary<MachineField, string> machineMappings)
|
2020-09-02 23:02:06 -07:00
|
|
|
|
{
|
|
|
|
|
|
// Set base fields
|
2020-12-13 13:22:06 -08:00
|
|
|
|
base.SetFields(datItemMappings, machineMappings);
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
|
|
|
|
|
// Handle Control-specific fields
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemMappings.Keys.Contains(DatItemField.Control_Type))
|
|
|
|
|
|
ControlType = datItemMappings[DatItemField.Control_Type].AsControlType();
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemMappings.Keys.Contains(DatItemField.Control_Player))
|
|
|
|
|
|
Player = Utilities.CleanLong(datItemMappings[DatItemField.Control_Player]);
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemMappings.Keys.Contains(DatItemField.Control_Buttons))
|
|
|
|
|
|
Buttons = Utilities.CleanLong(datItemMappings[DatItemField.Control_Buttons]);
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemMappings.Keys.Contains(DatItemField.Control_RequiredButtons))
|
|
|
|
|
|
RequiredButtons = Utilities.CleanLong(datItemMappings[DatItemField.Control_RequiredButtons]);
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemMappings.Keys.Contains(DatItemField.Control_Minimum))
|
|
|
|
|
|
Minimum = Utilities.CleanLong(datItemMappings[DatItemField.Control_Minimum]);
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemMappings.Keys.Contains(DatItemField.Control_Maximum))
|
|
|
|
|
|
Maximum = Utilities.CleanLong(datItemMappings[DatItemField.Control_Maximum]);
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemMappings.Keys.Contains(DatItemField.Control_Sensitivity))
|
|
|
|
|
|
Sensitivity = Utilities.CleanLong(datItemMappings[DatItemField.Control_Sensitivity]);
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemMappings.Keys.Contains(DatItemField.Control_KeyDelta))
|
|
|
|
|
|
KeyDelta = Utilities.CleanLong(datItemMappings[DatItemField.Control_KeyDelta]);
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemMappings.Keys.Contains(DatItemField.Control_Reverse))
|
|
|
|
|
|
Reverse = datItemMappings[DatItemField.Control_Reverse].AsYesNo();
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemMappings.Keys.Contains(DatItemField.Control_Ways))
|
|
|
|
|
|
Ways = datItemMappings[DatItemField.Control_Ways];
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemMappings.Keys.Contains(DatItemField.Control_Ways2))
|
|
|
|
|
|
Ways2 = datItemMappings[DatItemField.Control_Ways2];
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemMappings.Keys.Contains(DatItemField.Control_Ways3))
|
|
|
|
|
|
Ways3 = datItemMappings[DatItemField.Control_Ways3];
|
2020-09-02 23:02:06 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Constructors
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Create a default, empty Control object
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public Control()
|
|
|
|
|
|
{
|
|
|
|
|
|
ItemType = ItemType.Control;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Cloning Methods
|
|
|
|
|
|
|
|
|
|
|
|
public override object Clone()
|
|
|
|
|
|
{
|
|
|
|
|
|
return new Control()
|
|
|
|
|
|
{
|
|
|
|
|
|
ItemType = this.ItemType,
|
|
|
|
|
|
DupeType = this.DupeType,
|
|
|
|
|
|
|
|
|
|
|
|
Machine = this.Machine.Clone() as Machine,
|
|
|
|
|
|
Source = this.Source.Clone() as Source,
|
|
|
|
|
|
Remove = this.Remove,
|
|
|
|
|
|
|
|
|
|
|
|
ControlType = this.ControlType,
|
|
|
|
|
|
Player = this.Player,
|
|
|
|
|
|
Buttons = this.Buttons,
|
2020-09-06 23:00:13 -07:00
|
|
|
|
RequiredButtons = this.RequiredButtons,
|
2020-09-02 23:02:06 -07:00
|
|
|
|
Minimum = this.Minimum,
|
|
|
|
|
|
Maximum = this.Maximum,
|
|
|
|
|
|
Sensitivity = this.Sensitivity,
|
|
|
|
|
|
KeyDelta = this.KeyDelta,
|
|
|
|
|
|
Reverse = this.Reverse,
|
|
|
|
|
|
Ways = this.Ways,
|
|
|
|
|
|
Ways2 = this.Ways2,
|
|
|
|
|
|
Ways3 = this.Ways3,
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Comparision Methods
|
|
|
|
|
|
|
|
|
|
|
|
public override bool Equals(DatItem other)
|
|
|
|
|
|
{
|
|
|
|
|
|
// If we don't have a Control, return false
|
|
|
|
|
|
if (ItemType != other.ItemType)
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
// Otherwise, treat it as a Control
|
|
|
|
|
|
Control newOther = other as Control;
|
|
|
|
|
|
|
|
|
|
|
|
// If the Control information matches
|
|
|
|
|
|
return (ControlType == newOther.ControlType
|
|
|
|
|
|
&& Player == newOther.Player
|
|
|
|
|
|
&& Buttons == newOther.Buttons
|
2020-09-06 23:00:13 -07:00
|
|
|
|
&& RequiredButtons == newOther.RequiredButtons
|
2020-09-02 23:02:06 -07:00
|
|
|
|
&& Minimum == newOther.Minimum
|
|
|
|
|
|
&& Maximum == newOther.Maximum
|
|
|
|
|
|
&& Sensitivity == newOther.Sensitivity
|
|
|
|
|
|
&& KeyDelta == newOther.KeyDelta
|
|
|
|
|
|
&& Reverse == newOther.Reverse
|
|
|
|
|
|
&& Ways == newOther.Ways
|
|
|
|
|
|
&& Ways2 == newOther.Ways2
|
|
|
|
|
|
&& Ways3 == newOther.Ways3);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Filtering
|
|
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public override void RemoveFields(
|
|
|
|
|
|
List<DatItemField> datItemFields,
|
|
|
|
|
|
List<MachineField> machineFields)
|
2020-09-02 23:02:06 -07:00
|
|
|
|
{
|
|
|
|
|
|
// Remove common fields first
|
2020-12-13 13:22:06 -08:00
|
|
|
|
base.RemoveFields(datItemFields, machineFields);
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
|
|
|
|
|
// Remove the fields
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_Type))
|
2020-09-06 23:00:13 -07:00
|
|
|
|
ControlType = ControlType.NULL;
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_Player))
|
2020-09-02 23:02:06 -07:00
|
|
|
|
Player = null;
|
|
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_Buttons))
|
2020-09-02 23:02:06 -07:00
|
|
|
|
Buttons = null;
|
|
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_RequiredButtons))
|
2020-09-06 23:00:13 -07:00
|
|
|
|
RequiredButtons = null;
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_Minimum))
|
2020-09-02 23:02:06 -07:00
|
|
|
|
Minimum = null;
|
|
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_Maximum))
|
2020-09-02 23:02:06 -07:00
|
|
|
|
Maximum = null;
|
|
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_Sensitivity))
|
2020-09-02 23:02:06 -07:00
|
|
|
|
Sensitivity = null;
|
|
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_KeyDelta))
|
2020-09-02 23:02:06 -07:00
|
|
|
|
KeyDelta = null;
|
|
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_Reverse))
|
2020-09-02 23:02:06 -07:00
|
|
|
|
Reverse = null;
|
|
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_Ways))
|
2020-09-02 23:02:06 -07:00
|
|
|
|
Ways = null;
|
|
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_Ways2))
|
2020-09-02 23:02:06 -07:00
|
|
|
|
Ways2 = null;
|
|
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_Ways3))
|
2020-09-02 23:02:06 -07:00
|
|
|
|
Ways3 = null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Sorting and Merging
|
|
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public override void ReplaceFields(
|
|
|
|
|
|
DatItem item,
|
|
|
|
|
|
List<DatItemField> datItemFields,
|
|
|
|
|
|
List<MachineField> machineFields)
|
2020-09-02 23:02:06 -07:00
|
|
|
|
{
|
|
|
|
|
|
// Replace common fields first
|
2020-12-13 13:22:06 -08:00
|
|
|
|
base.ReplaceFields(item, datItemFields, machineFields);
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
|
|
|
|
|
// If we don't have a Control to replace from, ignore specific fields
|
|
|
|
|
|
if (item.ItemType != ItemType.Control)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
// Cast for easier access
|
|
|
|
|
|
Control newItem = item as Control;
|
|
|
|
|
|
|
|
|
|
|
|
// Replace the fields
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_Type))
|
2020-09-02 23:02:06 -07:00
|
|
|
|
ControlType = newItem.ControlType;
|
|
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_Player))
|
2020-09-02 23:02:06 -07:00
|
|
|
|
Player = newItem.Player;
|
|
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_Buttons))
|
2020-09-02 23:02:06 -07:00
|
|
|
|
Buttons = newItem.Buttons;
|
|
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_RequiredButtons))
|
2020-09-06 23:00:13 -07:00
|
|
|
|
RequiredButtons = newItem.RequiredButtons;
|
2020-09-02 23:02:06 -07:00
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_Minimum))
|
2020-09-02 23:02:06 -07:00
|
|
|
|
Minimum = newItem.Minimum;
|
|
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_Maximum))
|
2020-09-02 23:02:06 -07:00
|
|
|
|
Maximum = newItem.Maximum;
|
|
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_Sensitivity))
|
2020-09-02 23:02:06 -07:00
|
|
|
|
Sensitivity = newItem.Sensitivity;
|
|
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_KeyDelta))
|
2020-09-02 23:02:06 -07:00
|
|
|
|
KeyDelta = newItem.KeyDelta;
|
|
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_Reverse))
|
2020-09-02 23:02:06 -07:00
|
|
|
|
Reverse = newItem.Reverse;
|
|
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_Ways))
|
2020-09-02 23:02:06 -07:00
|
|
|
|
Ways = newItem.Ways;
|
|
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_Ways2))
|
2020-09-02 23:02:06 -07:00
|
|
|
|
Ways2 = newItem.Ways2;
|
|
|
|
|
|
|
2020-12-13 13:22:06 -08:00
|
|
|
|
if (datItemFields.Contains(DatItemField.Control_Ways3))
|
2020-09-02 23:02:06 -07:00
|
|
|
|
Ways3 = newItem.Ways3;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|