using PkmnLib.Dynamic.Models;

namespace PkmnLib.Dynamic.Events;

/// <summary>
/// Event data for when a Pokémon attempts to flee from battle. Indicates which Pokémon attempted to flee and whether the attempt was successful.
/// </summary>
public class FleeEvent : IEventData
{
    /// <inheritdoc cref="FleeEvent"/>
    public FleeEvent(IPokemon pokemon, bool success)
    {
        Pokemon = pokemon;
        Success = success;
    }

    /// <summary>
    /// The Pokémon that attempted to flee.
    /// </summary>
    public IPokemon Pokemon { get; }

    /// <summary>
    /// Indicates whether the flee attempt was successful.
    /// </summary>
    public bool Success { get; }

    /// <inheritdoc />
    public EventBatchId BatchId { get; init; }
}