mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
34 lines
979 B
C#
34 lines
979 B
C#
using System.Xml.Serialization;
|
|
using Newtonsoft.Json;
|
|
using SabreTools.Core.Tools;
|
|
|
|
namespace SabreTools.DatItems.Formats
|
|
{
|
|
/// <summary>
|
|
/// Represents a condition on a machine or other item
|
|
/// </summary>
|
|
[JsonObject("condition"), XmlRoot("condition")]
|
|
public sealed class Condition : DatItem<Models.Metadata.Condition>
|
|
{
|
|
#region Fields
|
|
|
|
/// <inheritdoc>/>
|
|
protected override ItemType ItemType => ItemType.Condition;
|
|
|
|
#endregion
|
|
|
|
#region Constructors
|
|
|
|
public Condition() : base() { }
|
|
|
|
public Condition(Models.Metadata.Condition item) : base(item)
|
|
{
|
|
// Process flag values
|
|
if (GetStringFieldValue(Models.Metadata.Condition.RelationKey) != null)
|
|
SetFieldValue<string?>(Models.Metadata.Condition.RelationKey, GetStringFieldValue(Models.Metadata.Condition.RelationKey).AsEnumValue<Relation>().AsStringValue());
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|