2023-08-01 23:18:53 -04:00
|
|
|
using System.Xml.Serialization;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
|
|
|
|
namespace SabreTools.Models.Internal
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Format-agnostic representation of item data
|
|
|
|
|
/// </summary>
|
2023-08-07 21:10:47 -04:00
|
|
|
public class DatItem : DictionaryBase
|
2023-08-01 23:18:53 -04:00
|
|
|
{
|
|
|
|
|
#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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|