mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Remove nearly all explict fields
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Core.Tools;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -12,54 +10,6 @@ namespace SabreTools.DatItems.Formats
|
||||
[JsonObject("condition"), XmlRoot("condition")]
|
||||
public class Condition : DatItem
|
||||
{
|
||||
#region Fields
|
||||
|
||||
/// <summary>
|
||||
/// Condition tag value
|
||||
/// </summary>
|
||||
[JsonProperty("tag", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("tag")]
|
||||
public string? Tag
|
||||
{
|
||||
get => _internal.ReadString(Models.Metadata.Condition.TagKey);
|
||||
set => _internal[Models.Metadata.Condition.TagKey] = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Condition mask
|
||||
/// </summary>
|
||||
[JsonProperty("mask", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("mask")]
|
||||
public string? Mask
|
||||
{
|
||||
get => _internal.ReadString(Models.Metadata.Condition.MaskKey);
|
||||
set => _internal[Models.Metadata.Condition.MaskKey] = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Condition relationship
|
||||
/// </summary>
|
||||
[JsonProperty("relation", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("relation")]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public Relation Relation
|
||||
{
|
||||
get => _internal.ReadString(Models.Metadata.Condition.RelationKey).AsEnumValue<Relation>();
|
||||
set => _internal[Models.Metadata.Condition.RelationKey] = value.AsStringValue<Relation>();
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public bool RelationSpecified { get { return Relation != Core.Relation.NULL; } }
|
||||
|
||||
/// <summary>
|
||||
/// Condition value
|
||||
/// </summary>
|
||||
[JsonProperty("value", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("value")]
|
||||
public string? Value
|
||||
{
|
||||
get => _internal.ReadString(Models.Metadata.Condition.ValueKey);
|
||||
set => _internal[Models.Metadata.Condition.ValueKey] = value;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user