mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
63 lines
1.5 KiB
C#
63 lines
1.5 KiB
C#
using System.Xml.Serialization;
|
|
using Newtonsoft.Json;
|
|
using SabreTools.Core;
|
|
|
|
namespace SabreTools.DatItems.Formats
|
|
{
|
|
/// <summary>
|
|
/// Represents a single analog item
|
|
/// </summary>
|
|
[JsonObject("analog"), XmlRoot("analog")]
|
|
public class Analog : DatItem
|
|
{
|
|
#region Fields
|
|
|
|
/// <summary>
|
|
/// Analog mask value
|
|
/// </summary>
|
|
[JsonProperty("mask", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("mask")]
|
|
public string? Mask
|
|
{
|
|
get => _internal.ReadString(Models.Metadata.Analog.MaskKey);
|
|
set => _internal[Models.Metadata.Analog.MaskKey] = value;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Constructors
|
|
|
|
/// <summary>
|
|
/// Create a default, empty Analog object
|
|
/// </summary>
|
|
public Analog()
|
|
{
|
|
_internal = new Models.Metadata.Analog();
|
|
Machine = new Machine();
|
|
|
|
ItemType = ItemType.Analog;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Cloning Methods
|
|
|
|
/// <inheritdoc/>
|
|
public override object Clone()
|
|
{
|
|
return new Analog()
|
|
{
|
|
ItemType = this.ItemType,
|
|
DupeType = this.DupeType,
|
|
|
|
Machine = this.Machine.Clone() as Machine ?? new Machine(),
|
|
Source = this.Source?.Clone() as Source,
|
|
Remove = this.Remove,
|
|
|
|
_internal = this._internal?.Clone() as Models.Metadata.Analog ?? [],
|
|
};
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|