Files
SabreTools/SabreTools.DatItems/Formats/Port.cs

40 lines
936 B
C#
Raw Normal View History

2024-03-09 21:34:26 -05:00
using System.Xml.Serialization;
2020-09-02 17:22:31 -07:00
using Newtonsoft.Json;
2021-02-02 10:23:43 -08:00
namespace SabreTools.DatItems.Formats
2020-09-02 17:22:31 -07:00
{
/// <summary>
/// Represents a single port on a machine
/// </summary>
2020-09-08 10:12:41 -07:00
[JsonObject("port"), XmlRoot("port")]
2024-03-10 20:39:54 -04:00
public sealed class Port : DatItem<Models.Metadata.Port>
2020-09-02 17:22:31 -07:00
{
#region Fields
2024-03-10 20:39:54 -04:00
/// <inheritdoc>/>
protected override ItemType ItemType => ItemType.Port;
/// <inheritdoc>/>
protected override string? NameKey => null;
2024-03-09 21:34:26 -05:00
[JsonIgnore]
public bool AnalogsSpecified
{
2024-03-09 21:34:26 -05:00
get
{
var analogs = GetFieldValue<Analog[]?>(Models.Metadata.Port.AnalogKey);
return analogs != null && analogs.Length > 0;
}
}
2020-09-02 17:22:31 -07:00
#endregion
#region Constructors
2024-03-10 20:39:54 -04:00
public Port() : base() { }
public Port(Models.Metadata.Port item) : base(item) { }
2020-09-02 17:22:31 -07:00
#endregion
}
}