using System.Xml.Serialization;
using Newtonsoft.Json;
using SabreTools.Core.Tools;
namespace SabreTools.DatItems.Formats
{
///
/// Represents which Chip(s) is associated with a set
///
[JsonObject("chip"), XmlRoot("chip")]
public sealed class Chip : DatItem
{
#region Fields
/// />
protected override ItemType ItemType => ItemType.Chip;
#endregion
#region Constructors
public Chip() : base() { }
public Chip(Models.Metadata.Chip item) : base(item)
{
// Process flag values
if (GetBoolFieldValue(Models.Metadata.Chip.SoundOnlyKey) != null)
SetFieldValue(Models.Metadata.Chip.SoundOnlyKey, GetBoolFieldValue(Models.Metadata.Chip.SoundOnlyKey).FromYesNo());
if (GetStringFieldValue(Models.Metadata.Chip.ChipTypeKey) != null)
SetFieldValue(Models.Metadata.Chip.ChipTypeKey, GetStringFieldValue(Models.Metadata.Chip.ChipTypeKey).AsEnumValue().AsStringValue());
}
#endregion
}
}