2023-08-14 13:17:51 -04:00
|
|
|
using System.Xml.Serialization;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using SabreTools.Core;
|
|
|
|
|
|
|
|
|
|
namespace SabreTools.DatItems.Formats
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Represents one diplocation
|
|
|
|
|
/// </summary>
|
|
|
|
|
[JsonObject("diplocation"), XmlRoot("diplocation")]
|
|
|
|
|
public class DipLocation : DatItem
|
|
|
|
|
{
|
|
|
|
|
#region Accessors
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
2024-03-08 15:31:21 -05:00
|
|
|
public override string? GetName() => GetFieldValue<string>(Models.Metadata.DipLocation.NameKey);
|
2023-08-14 13:17:51 -04:00
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
2024-03-08 15:31:21 -05:00
|
|
|
public override void SetName(string? name) => SetFieldValue(Models.Metadata.DipLocation.NameKey, name);
|
2023-08-14 13:17:51 -04:00
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Constructors
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Create a default, empty DipLocation object
|
|
|
|
|
/// </summary>
|
|
|
|
|
public DipLocation()
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
_internal = new Models.Metadata.DipLocation();
|
2023-08-15 01:38:01 -04:00
|
|
|
|
2024-03-08 20:42:24 -05:00
|
|
|
SetName(string.Empty);
|
2024-03-10 16:49:07 -04:00
|
|
|
SetFieldValue<ItemType>(Models.Metadata.DatItem.TypeKey, ItemType.DipLocation);
|
|
|
|
|
SetFieldValue<Machine>(DatItem.MachineKey, new Machine());
|
2023-08-14 13:17:51 -04:00
|
|
|
}
|
|
|
|
|
|
2024-03-09 21:46:38 -05:00
|
|
|
/// <summary>
|
|
|
|
|
/// Create a DipLocation object from the internal model
|
|
|
|
|
/// </summary>
|
|
|
|
|
public DipLocation(Models.Metadata.DipLocation? item)
|
|
|
|
|
{
|
|
|
|
|
_internal = item ?? [];
|
|
|
|
|
|
2024-03-10 16:49:07 -04:00
|
|
|
SetFieldValue<ItemType>(Models.Metadata.DatItem.TypeKey, ItemType.DipLocation);
|
|
|
|
|
SetFieldValue<Machine>(DatItem.MachineKey, new Machine());
|
2024-03-09 21:46:38 -05:00
|
|
|
}
|
|
|
|
|
|
2023-08-14 13:17:51 -04:00
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Cloning Methods
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
public override object Clone()
|
|
|
|
|
{
|
|
|
|
|
return new DipLocation()
|
|
|
|
|
{
|
2024-02-28 19:19:50 -05:00
|
|
|
_internal = this._internal?.Clone() as Models.Metadata.DipLocation ?? [],
|
2023-08-14 13:17:51 -04:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|