using System.Xml.Serialization;
using Newtonsoft.Json;
using SabreTools.Core;
namespace SabreTools.DatItems.Formats
{
///
/// Represents one ListXML input
///
[JsonObject("input"), XmlRoot("input")]
public class Input : DatItem
{
#region Fields
[JsonIgnore]
public bool ControlsSpecified
{
get
{
var controls = GetFieldValue(Models.Metadata.Input.ControlKey);
return controls != null && controls.Length > 0;
}
}
#endregion
#region Constructors
///
/// Create a default, empty Input object
///
public Input()
{
_internal = new Models.Metadata.Input();
Machine = new Machine();
ItemType = ItemType.Input;
}
#endregion
#region Cloning Methods
///
public override object Clone()
{
return new Input()
{
ItemType = this.ItemType,
DupeType = this.DupeType,
Machine = this.Machine.Clone() as Machine ?? new Machine(),
Source = this.Source?.Clone() as Source,
Remove = this.Remove,
_internal = this._internal?.Clone() as Models.Metadata.Input ?? [],
};
}
#endregion
}
}