mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Convert remaining items, add NameKey
This commit is contained in:
@@ -8,10 +8,16 @@ namespace SabreTools.DatItems.Formats
|
||||
/// Represents one ListXML input
|
||||
/// </summary>
|
||||
[JsonObject("input"), XmlRoot("input")]
|
||||
public class Input : DatItem
|
||||
public sealed class Input : DatItem<Models.Metadata.Input>
|
||||
{
|
||||
#region Fields
|
||||
|
||||
/// <inheritdoc>/>
|
||||
protected override ItemType ItemType => ItemType.Input;
|
||||
|
||||
/// <inheritdoc>/>
|
||||
protected override string? NameKey => null;
|
||||
|
||||
[JsonIgnore]
|
||||
public bool ControlsSpecified
|
||||
{
|
||||
@@ -26,40 +32,8 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Create a default, empty Input object
|
||||
/// </summary>
|
||||
public Input()
|
||||
{
|
||||
_internal = new Models.Metadata.Input();
|
||||
|
||||
SetFieldValue<ItemType>(Models.Metadata.DatItem.TypeKey, ItemType.Input);
|
||||
SetFieldValue<Machine>(DatItem.MachineKey, new Machine());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create an Input object from the internal model
|
||||
/// </summary>
|
||||
public Input(Models.Metadata.Input item)
|
||||
{
|
||||
_internal = item;
|
||||
|
||||
SetFieldValue<ItemType>(Models.Metadata.DatItem.TypeKey, ItemType.Input);
|
||||
SetFieldValue<Machine>(DatItem.MachineKey, new Machine());
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override object Clone()
|
||||
{
|
||||
return new Input()
|
||||
{
|
||||
_internal = this._internal?.Clone() as Models.Metadata.Input ?? [],
|
||||
};
|
||||
}
|
||||
public Input() : base() { }
|
||||
public Input(Models.Metadata.Input item) : base(item) { }
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user