PkmnLib.NET/PkmnLib.Dynamic/Events/AbilityTriggerEvent.cs
Deukhoofd 97868ab4c6
All checks were successful
Build / Build (push) Successful in 48s
More abilities
2025-06-09 13:44:26 +02:00

33 lines
873 B
C#

using PkmnLib.Dynamic.Models;
using PkmnLib.Static.Species;
using PkmnLib.Static.Utils;
namespace PkmnLib.Dynamic.Events;
/// <summary>
/// AbilityTriggerEvent is triggered when a Pokémon's ability is activated.
/// </summary>
public record AbilityTriggerEvent : IEventData
{
/// <summary>
/// The Pokémon whose ability is being triggered.
/// </summary>
public IPokemon Pokemon { get; }
/// <summary>
/// The ability that is being triggered for the Pokémon.
/// </summary>
public IAbility? Ability { get; }
public Dictionary<StringKey, object?>? Metadata { get; init; } = null;
/// <inheritdoc cref="AbilityTriggerEvent"/>
public AbilityTriggerEvent(IPokemon pokemon)
{
Pokemon = pokemon;
Ability = pokemon.ActiveAbility;
}
/// <inheritdoc />
public EventBatchId BatchId { get; init; }
}