mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
60 lines
1.6 KiB
C#
60 lines
1.6 KiB
C#
using System.Xml.Serialization;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace SabreTools.DatItems.Formats
|
|
{
|
|
/// <summary>
|
|
/// Represents which Configuration(s) is associated with a set
|
|
/// </summary>
|
|
[JsonObject("configuration"), XmlRoot("configuration")]
|
|
public sealed class Configuration : DatItem<Models.Metadata.Configuration>
|
|
{
|
|
#region Fields
|
|
|
|
/// <inheritdoc>/>
|
|
protected override ItemType ItemType => ItemType.Configuration;
|
|
|
|
/// <inheritdoc>/>
|
|
protected override string? NameKey => Models.Metadata.Configuration.NameKey;
|
|
|
|
[JsonIgnore]
|
|
public bool ConditionsSpecified
|
|
{
|
|
get
|
|
{
|
|
var conditions = GetFieldValue<Condition[]?>(Models.Metadata.Configuration.ConditionKey);
|
|
return conditions != null && conditions.Length > 0;
|
|
}
|
|
}
|
|
|
|
[JsonIgnore]
|
|
public bool LocationsSpecified
|
|
{
|
|
get
|
|
{
|
|
var locations = GetFieldValue<ConfLocation[]?>(Models.Metadata.Configuration.ConfLocationKey);
|
|
return locations != null && locations.Length > 0;
|
|
}
|
|
}
|
|
|
|
[JsonIgnore]
|
|
public bool SettingsSpecified
|
|
{
|
|
get
|
|
{
|
|
var settings = GetFieldValue<ConfSetting[]?>(Models.Metadata.Configuration.ConfSettingKey);
|
|
return settings != null && settings.Length > 0;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Constructors
|
|
|
|
public Configuration() : base() { }
|
|
public Configuration(Models.Metadata.Configuration item) : base(item) { }
|
|
|
|
#endregion
|
|
}
|
|
}
|