Initial work on implementing Pokemon

This commit is contained in:
2024-07-28 14:00:26 +02:00
parent 3d5fb1a818
commit 554e1cf2cd
15 changed files with 603 additions and 30 deletions

View File

@@ -0,0 +1,21 @@
namespace PkmnLib.Dynamic.Events;
/// <summary>
/// The event hook of a battle. This is used to hook into the battle and get notified when something
/// happens that a front-end might want to know about.
/// </summary>
public class EventHook
{
/// <summary>
/// The event handler that is called when the event is triggered.
/// </summary>
public event EventHandler<IEventData>? Handler;
/// <summary>
/// Triggers the event, calling the handler with the given data.
/// </summary>
public void Invoke(IEventData data)
{
Handler?.Invoke(this, data);
}
}