mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Remove nearly all explict fields
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
|
||||
@@ -14,71 +12,16 @@ namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
#region Fields
|
||||
|
||||
/// <summary>
|
||||
/// Input service ID
|
||||
/// </summary>
|
||||
[JsonProperty("service", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("service")]
|
||||
public bool? Service
|
||||
{
|
||||
get => _internal.ReadBool(Models.Metadata.Input.ServiceKey);
|
||||
set => _internal[Models.Metadata.Input.ServiceKey] = value;
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public bool ServiceSpecified { get { return Service != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Determins if this has a tilt sensor
|
||||
/// </summary>
|
||||
[JsonProperty("tilt", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("tilt")]
|
||||
public bool? Tilt
|
||||
public bool ControlsSpecified
|
||||
{
|
||||
get => _internal.ReadBool(Models.Metadata.Input.TiltKey);
|
||||
set => _internal[Models.Metadata.Input.TiltKey] = value;
|
||||
get
|
||||
{
|
||||
var controls = GetFieldValue<Control[]?>(Models.Metadata.Input.ControlKey);
|
||||
return controls != null && controls.Length > 0;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public bool TiltSpecified { get { return Tilt != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Number of players on the input
|
||||
/// </summary>
|
||||
[JsonProperty("players", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("players")]
|
||||
public long? Players
|
||||
{
|
||||
get => _internal.ReadLong(Models.Metadata.Input.PlayersKey);
|
||||
set => _internal[Models.Metadata.Input.PlayersKey] = value;
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public bool PlayersSpecified { get { return Players != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Number of coins required
|
||||
/// </summary>
|
||||
[JsonProperty("coins", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("coins")]
|
||||
public long? Coins
|
||||
{
|
||||
get => _internal.ReadLong(Models.Metadata.Input.CoinsKey);
|
||||
set => _internal[Models.Metadata.Input.CoinsKey] = value;
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public bool CoinsSpecified { get { return Coins != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Set of controls for the input
|
||||
/// </summary>
|
||||
[JsonProperty("controls", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("controls")]
|
||||
public List<Control>? Controls
|
||||
{
|
||||
get => _internal.Read<Control[]>(Models.Metadata.Input.ControlKey)?.ToList();
|
||||
set => _internal[Models.Metadata.Input.ControlKey] = value?.ToArray();
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public bool ControlsSpecified { get { return Controls != null && Controls.Count > 0; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
Reference in New Issue
Block a user