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

@@ -14,15 +14,15 @@ public class FlameWheelTests
/// <summary>
/// Creates a fully mocked test setup for Flame Wheel tests, initialized with the given burn chance.
/// </summary>
private static (FlameWheel script, IExecutingMove move, IPokemon user, IPokemon target, IBattleRandom random)
CreateTestSetup(float burnChance = 10f)
private static (FlameWheel script, IExecutingMove move, IBattlePokemon user, IBattlePokemon target, IBattleRandom
random) CreateTestSetup(float burnChance = 10f)
{
var script = new FlameWheel();
script.OnInitialize(new Dictionary<StringKey, object?> { { "burn_chance", burnChance } });
var move = Substitute.For<IExecutingMove>();
var user = Substitute.For<IPokemon>();
var target = Substitute.For<IPokemon>();
var user = Substitute.For<IBattlePokemon>();
var target = Substitute.For<IBattlePokemon>();
var battle = Substitute.For<IBattle>();
var random = Substitute.For<IBattleRandom>();
@@ -36,14 +36,14 @@ public class FlameWheelTests
/// <summary>
/// Helper that checks whether a Pokémon received a SetStatus call for the given status.
/// </summary>
private static bool ReceivedSetStatus(IPokemon pokemon, string status) =>
private static bool ReceivedSetStatus(IBattlePokemon pokemon, string status) =>
pokemon.ReceivedCalls().Any(c =>
c.GetMethodInfo().Name == "SetStatus" && (StringKey)c.GetArguments()[0]! == new StringKey(status));
/// <summary>
/// Helper that checks whether a Pokémon received a ClearStatus call.
/// </summary>
private static bool ReceivedClearStatus(IPokemon pokemon) =>
private static bool ReceivedClearStatus(IBattlePokemon pokemon) =>
pokemon.ReceivedCalls().Any(c => c.GetMethodInfo().Name == "ClearStatus");
/// <summary>