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 conflocation
|
|
|
|
|
/// </summary>
|
|
|
|
|
[JsonObject("conflocation"), XmlRoot("conflocation")]
|
|
|
|
|
public class ConfLocation : DatItem
|
|
|
|
|
{
|
|
|
|
|
#region Accessors
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
2024-03-08 15:31:21 -05:00
|
|
|
public override string? GetName() => GetFieldValue<string>(Models.Metadata.ConfLocation.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.ConfLocation.NameKey, name);
|
2023-08-14 13:17:51 -04:00
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Constructors
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Create a default, empty ConfLocation object
|
|
|
|
|
/// </summary>
|
|
|
|
|
public ConfLocation()
|
|
|
|
|
{
|
2023-09-04 23:51:37 -04:00
|
|
|
_internal = new Models.Metadata.ConfLocation();
|
2023-08-15 01:38:01 -04:00
|
|
|
Machine = new Machine();
|
|
|
|
|
|
2024-03-08 20:42:24 -05:00
|
|
|
SetName(string.Empty);
|
2023-08-14 13:17:51 -04:00
|
|
|
ItemType = ItemType.ConfLocation;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Cloning Methods
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
public override object Clone()
|
|
|
|
|
{
|
|
|
|
|
return new ConfLocation()
|
|
|
|
|
{
|
|
|
|
|
ItemType = this.ItemType,
|
|
|
|
|
DupeType = this.DupeType,
|
|
|
|
|
|
2023-08-15 01:38:01 -04:00
|
|
|
Machine = this.Machine.Clone() as Machine ?? new Machine(),
|
2023-08-14 13:17:51 -04:00
|
|
|
Source = this.Source?.Clone() as Source,
|
|
|
|
|
Remove = this.Remove,
|
|
|
|
|
|
2024-02-28 19:19:50 -05:00
|
|
|
_internal = this._internal?.Clone() as Models.Metadata.ConfLocation ?? [],
|
2023-08-14 13:17:51 -04:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|