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

@@ -70,8 +70,8 @@ public class MultiAttackTests
// Arrange
var move = Substitute.For<IExecutingMove>();
var target = Substitute.For<IPokemon>();
var user = Substitute.For<IPokemon>();
var target = Substitute.For<IBattlePokemon>();
var user = Substitute.For<IBattlePokemon>();
TypeIdentifier? typeIdentifier = new TypeIdentifier(1, "Normal");
var dynamicLibrary = Substitute.For<IDynamicLibrary>();
var staticLibrary = Substitute.For<IStaticLibrary>();
@@ -101,14 +101,14 @@ public class MultiAttackTests
/// Creates a mocked executing move whose user holds a fire_memory, with a type library that knows both
/// "normal" and "fire".
/// </summary>
private static (IExecutingMove move, IPokemon user) CreateMemoryHolderSetup()
private static (IExecutingMove move, IBattlePokemon user) CreateMemoryHolderSetup()
{
var typeLibrary = new TypeLibrary();
typeLibrary.RegisterType("normal");
typeLibrary.RegisterType("fire");
var move = Substitute.For<IExecutingMove>();
var user = Substitute.For<IPokemon>();
var user = Substitute.For<IBattlePokemon>();
var dynamicLibrary = Substitute.For<IDynamicLibrary>();
var staticLibrary = Substitute.For<IStaticLibrary>();
var item = Substitute.For<IItem>();
@@ -140,7 +140,7 @@ public class MultiAttackTests
var multiAttack = new MultiAttack();
// Act
multiAttack.ChangeMoveType(move, Substitute.For<IPokemon>(), 0, ref typeIdentifier);
multiAttack.ChangeMoveType(move, Substitute.For<IBattlePokemon>(), 0, ref typeIdentifier);
// Assert
await Assert.That(typeIdentifier!.Value.Name.ToString()).IsEqualTo("normal");
@@ -168,7 +168,7 @@ public class MultiAttackTests
var multiAttack = new MultiAttack();
// Act
multiAttack.ChangeMoveType(move, Substitute.For<IPokemon>(), 0, ref typeIdentifier);
multiAttack.ChangeMoveType(move, Substitute.For<IBattlePokemon>(), 0, ref typeIdentifier);
// Assert
await Assert.That(typeIdentifier!.Value.Name.ToString()).IsEqualTo("normal");