mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-04-05 22:01:33 +00:00
48 lines
1.3 KiB
C#
48 lines
1.3 KiB
C#
using System.Xml.Serialization;
|
|
using Newtonsoft.Json;
|
|
using SabreTools.Data.Extensions;
|
|
|
|
namespace SabreTools.Metadata.DatItems.Formats
|
|
{
|
|
/// <summary>
|
|
/// Represents one diplocation
|
|
/// </summary>
|
|
[JsonObject("diplocation"), XmlRoot("diplocation")]
|
|
public sealed class DipLocation : DatItem<Data.Models.Metadata.DipLocation>
|
|
{
|
|
#region Fields
|
|
|
|
/// <inheritdoc>/>
|
|
protected override ItemType ItemType => ItemType.DipLocation;
|
|
|
|
#endregion
|
|
|
|
#region Constructors
|
|
|
|
public DipLocation() : base() { }
|
|
|
|
public DipLocation(Data.Models.Metadata.DipLocation item) : base(item)
|
|
{
|
|
// Process flag values
|
|
bool? inverted = ReadBool(Data.Models.Metadata.DipLocation.InvertedKey);
|
|
if (inverted is not null)
|
|
Write<string?>(Data.Models.Metadata.DipLocation.InvertedKey, inverted.FromYesNo());
|
|
}
|
|
|
|
public DipLocation(Data.Models.Metadata.DipLocation item, Machine machine, Source source) : this(item)
|
|
{
|
|
Write<Source?>(SourceKey, source);
|
|
CopyMachineInformation(machine);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Cloning Methods
|
|
|
|
/// <inheritdoc/>
|
|
public override object Clone() => new DipLocation(_internal.Clone() as Data.Models.Metadata.DipLocation ?? []);
|
|
|
|
#endregion
|
|
}
|
|
}
|