Files
SabreTools/SabreTools.DatItems/Formats/Configuration.cs

60 lines
1.6 KiB
C#
Raw Normal View History

2024-03-09 21:34:26 -05:00
using System.Xml.Serialization;
2020-09-01 11:55:11 -07:00
using Newtonsoft.Json;
2021-02-02 10:23:43 -08:00
namespace SabreTools.DatItems.Formats
2020-09-01 11:55:11 -07:00
{
/// <summary>
/// Represents which Configuration(s) is associated with a set
/// </summary>
2020-09-08 10:12:41 -07:00
[JsonObject("configuration"), XmlRoot("configuration")]
2024-03-10 20:39:54 -04:00
public sealed class Configuration : DatItem<Models.Metadata.Configuration>
2020-09-01 11:55:11 -07:00
{
#region Fields
2024-03-10 20:39:54 -04:00
/// <inheritdoc>/>
protected override ItemType ItemType => ItemType.Configuration;
/// <inheritdoc>/>
protected override string? NameKey => Models.Metadata.Configuration.NameKey;
2024-03-09 21:34:26 -05:00
[JsonIgnore]
public bool ConditionsSpecified
{
2024-03-09 21:34:26 -05:00
get
{
var conditions = GetFieldValue<Condition[]?>(Models.Metadata.Configuration.ConditionKey);
return conditions != null && conditions.Length > 0;
}
}
2020-09-01 11:55:11 -07:00
2020-09-07 22:00:02 -07:00
[JsonIgnore]
2024-03-09 21:34:26 -05:00
public bool LocationsSpecified
{
2024-03-09 21:34:26 -05:00
get
{
var locations = GetFieldValue<ConfLocation[]?>(Models.Metadata.Configuration.ConfLocationKey);
return locations != null && locations.Length > 0;
}
}
2020-09-01 11:55:11 -07:00
2020-09-07 22:00:02 -07:00
[JsonIgnore]
2024-03-09 21:34:26 -05:00
public bool SettingsSpecified
{
2024-03-09 21:34:26 -05:00
get
{
var settings = GetFieldValue<ConfSetting[]?>(Models.Metadata.Configuration.ConfSettingKey);
return settings != null && settings.Length > 0;
}
}
2020-09-01 11:55:11 -07:00
#endregion
#region Constructors
2024-03-10 20:39:54 -04:00
public Configuration() : base() { }
public Configuration(Models.Metadata.Configuration item) : base(item) { }
2020-09-01 11:55:11 -07:00
#endregion
}
}