2023-08-14 13:17:51 -04:00
|
|
|
using System.Xml.Serialization;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
|
|
|
|
namespace SabreTools.DatItems.Formats
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Represents one ListXML confsetting
|
|
|
|
|
/// </summary>
|
|
|
|
|
[JsonObject("confsetting"), XmlRoot("confsetting")]
|
2024-03-10 20:39:54 -04:00
|
|
|
public sealed class ConfSetting : DatItem<Models.Metadata.ConfSetting>
|
2023-08-14 13:17:51 -04:00
|
|
|
{
|
|
|
|
|
#region Fields
|
|
|
|
|
|
2024-03-10 20:39:54 -04:00
|
|
|
/// <inheritdoc>/>
|
|
|
|
|
protected override ItemType ItemType => ItemType.ConfSetting;
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc>/>
|
|
|
|
|
protected override string? NameKey => Models.Metadata.ConfSetting.NameKey;
|
|
|
|
|
|
2023-08-14 13:17:51 -04:00
|
|
|
[JsonIgnore]
|
2024-03-09 21:34:26 -05:00
|
|
|
public bool ConditionsSpecified
|
2023-08-14 13:17:51 -04:00
|
|
|
{
|
2024-03-09 21:34:26 -05:00
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
var conditions = GetFieldValue<Condition[]?>(Models.Metadata.ConfSetting.ConditionKey);
|
|
|
|
|
return conditions != null && conditions.Length > 0;
|
|
|
|
|
}
|
2023-08-14 13:17:51 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Constructors
|
|
|
|
|
|
2024-03-10 20:39:54 -04:00
|
|
|
public ConfSetting() : base() { }
|
|
|
|
|
public ConfSetting(Models.Metadata.ConfSetting item) : base(item) { }
|
2023-08-14 13:17:51 -04:00
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|