Files
SabreTools/SabreTools.DatItems/Formats/Display.cs

60 lines
1.4 KiB
C#
Raw Normal View History

using System.Xml.Serialization;
2020-09-03 13:20:56 -07:00
using Newtonsoft.Json;
2022-11-03 12:22:17 -07:00
using SabreTools.Core;
2020-09-02 21:36:14 -07:00
2021-02-02 10:23:43 -08:00
namespace SabreTools.DatItems.Formats
2020-09-02 21:36:14 -07:00
{
/// <summary>
/// Represents one machine display
/// </summary>
2020-09-08 10:12:41 -07:00
[JsonObject("display"), XmlRoot("display")]
2020-09-02 21:36:14 -07:00
public class Display : DatItem
{
#region Constructors
/// <summary>
/// Create a default, empty Display object
/// </summary>
public Display()
{
2023-09-04 23:51:37 -04:00
_internal = new Models.Metadata.Display();
2023-08-15 01:38:01 -04:00
Machine = new Machine();
2020-09-02 21:36:14 -07:00
ItemType = ItemType.Display;
}
2024-03-09 21:46:38 -05:00
/// <summary>
/// Create a Display object from the internal model
/// </summary>
public Display(Models.Metadata.Display? item)
{
_internal = item ?? [];
Machine = new Machine();
ItemType = ItemType.Display;
}
2020-09-02 21:36:14 -07:00
#endregion
#region Cloning Methods
2022-11-03 12:22:17 -07:00
/// <inheritdoc/>
2020-09-02 21:36:14 -07:00
public override object Clone()
{
return new Display()
{
ItemType = this.ItemType,
DupeType = this.DupeType,
2023-08-15 01:38:01 -04:00
Machine = this.Machine.Clone() as Machine ?? new Machine(),
Source = this.Source?.Clone() as Source,
2020-09-02 21:36:14 -07:00
Remove = this.Remove,
2024-02-28 19:19:50 -05:00
_internal = this._internal?.Clone() as Models.Metadata.Display ?? [],
2020-09-02 21:36:14 -07:00
};
}
#endregion
}
}