Files
SabreTools/SabreTools.DatItems/Formats/ConfLocation.cs

60 lines
1.5 KiB
C#
Raw Normal View History

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);
/// <inheritdoc/>
2024-03-08 15:31:21 -05:00
public override void SetName(string? name) => SetFieldValue(Models.Metadata.ConfLocation.NameKey, name);
#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);
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(),
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 ?? [],
};
}
#endregion
}
}