using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;

namespace PkmnLib.Dynamic.Libraries.DataLoaders.Models;

/// <summary>
/// Represents a serialized item.
/// </summary>
public class SerializedItem
{
    /// <inheritdoc cref="PkmnLib.Static.Utils.INamedValue.Name" />
    public string Name { get; set; } = null!;

    /// <inheritdoc cref="PkmnLib.Static.IItem.Category" />
    public string ItemType { get; set; } = null!;

    /// <inheritdoc cref="PkmnLib.Static.IItem.BattleCategory" />
    public string BattleType { get; set; } = null!;

    /// <inheritdoc cref="PkmnLib.Static.IItem.Flags" />
    public string[] Flags { get; set; } = null!;

    /// <inheritdoc cref="PkmnLib.Static.IItem.Price" />
    public int Price { get; set; }

    /// <inheritdoc cref="PkmnLib.Static.IItem.Effect" />
    public SerializedMoveEffect? Effect { get; set; }

    /// <inheritdoc cref="PkmnLib.Static.IItem.BattleEffect" />
    public SerializedMoveEffect? BattleEffect { get; set; }

    /// <inheritdoc cref="PkmnLib.Static.IItem.AdditionalData" />
    public Dictionary<string, JsonNode>? AdditionalData { get; set; } = null!;

    /// <summary>
    /// A collection of non-standard data that can be set on the item.
    /// </summary>
    [JsonExtensionData]
    public Dictionary<string, JsonElement>? ExtensionData { get; set; }
}