Make event handler async, while preserving the order of incoming events.

This commit is contained in:
2020-08-07 20:28:38 +02:00
parent 90d5c2a16c
commit 1acd32b986
4 changed files with 23 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using NUnit.Framework;
using PkmnLibSharp.Battling;
using PkmnLibSharp.Battling.ChoiceTurn;
@@ -94,6 +95,7 @@ namespace PkmnLibSharpTests.Battling.BattleTests
battle.RegisterEventListener(new BattleEventListener(evt =>
{
evts.Add(evt);
return Task.CompletedTask;
}));
battle.SwitchPokemon(0, 0, p1.GetAtIndex(0));