mirror of
https://github.com/SabreTools/SabreTools.Models.git
synced 2026-09-24 07:37:10 +00:00
27 lines
715 B
C#
27 lines
715 B
C#
|
|
using System.Xml.Serialization;
|
||
|
|
using Newtonsoft.Json;
|
||
|
|
|
||
|
|
namespace SabreTools.Models.Metadata
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// Format-agnostic representation of item data
|
||
|
|
/// </summary>
|
||
|
|
public class DatItem : DictionaryBase
|
||
|
|
{
|
||
|
|
#region Common Keys
|
||
|
|
|
||
|
|
public const string TypeKey = "_type";
|
||
|
|
|
||
|
|
#endregion
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Quick accessor to item type, if it exists
|
||
|
|
/// </summary>
|
||
|
|
[JsonProperty("itemtype", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("itemtype")]
|
||
|
|
public ItemType? Type
|
||
|
|
{
|
||
|
|
get => ContainsKey(TypeKey) ? this[TypeKey] as ItemType? : null;
|
||
|
|
set => this[TypeKey] = value;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|