Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper

This commit is contained in:
2026-08-28 15:20:26 +02:00
parent 942be8eaeb
commit 8a2733a0a9
859 changed files with 4408 additions and 5331 deletions

View File

@@ -17,12 +17,12 @@ public class IncinerateTests
/// Creates a fully mocked test setup for Incinerate tests, with the target holding the given item
/// (nothing when null).
/// </summary>
private static (Incinerate script, IExecutingMove move, IPokemon target, IHitData hitData, EventHook eventHook)
CreateTestSetup(IItem? heldItem)
private static (Incinerate script, IExecutingMove move, IBattlePokemon target, IHitData hitData, EventHook eventHook
) CreateTestSetup(IItem? heldItem)
{
var script = new Incinerate();
var move = Substitute.For<IExecutingMove>();
var target = Substitute.For<IPokemon>();
var target = Substitute.For<IBattlePokemon>();
var hitData = Substitute.For<IHitData>();
move.GetHitData(target, 0).Returns(hitData);
@@ -58,7 +58,7 @@ public class IncinerateTests
/// <summary>
/// Helper to check whether the target's held item was taken away.
/// </summary>
private static bool ItemWasRemoved(IPokemon pokemon) =>
private static bool ItemWasRemoved(IBattlePokemon pokemon) =>
pokemon.ReceivedCalls().Any(c => c.GetMethodInfo().Name == "TryStealHeldItem");
/// <summary>