PkmnLib.NET/PkmnLib.Dynamic/Events/DamageEvent.cs

41 lines
1.0 KiB
C#

using PkmnLib.Dynamic.Models;
namespace PkmnLib.Dynamic.Events;
/// <summary>
/// Event triggered when a Pokemon takes damage.
/// </summary>
public record DamageEvent : IEventData
{
/// <inheritdoc cref="DamageEvent"/>
public DamageEvent(IPokemon pokemon, uint previousHealth, uint newHealth, DamageSource source)
{
Pokemon = pokemon;
PreviousHealth = previousHealth;
NewHealth = newHealth;
Source = source;
}
/// <summary>
/// The Pokemon that took damage.
/// </summary>
public IPokemon Pokemon { get; init; }
/// <summary>
/// The previous health of the Pokemon.
/// </summary>
public uint PreviousHealth { get; init; }
/// <summary>
/// The new health of the Pokemon.
/// </summary>
public uint NewHealth { get; init; }
/// <summary>
/// The source of the damage.
/// </summary>
public DamageSource Source { get; init; }
/// <inheritdoc />
public EventBatchId BatchId { get; init; } = new();
}