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

@@ -7,16 +7,31 @@ namespace PkmnLib.Tests.Dynamic;
public class PokemonStatBoostTests
{
private static IPokemon CreatePokemon()
private static IBattlePokemon CreatePokemon()
{
var library = LibraryHelpers.LoadLibrary();
if (!library.StaticLibrary.Species.TryGet("bulbasaur", out var species))
throw new InvalidOperationException("Failed to load bulbasaur species.");
return new PokemonImpl(library, species, species.GetDefaultForm(), new AbilityIndex
var pokemon = new PokemonImpl(library, species, species.GetDefaultForm(), new AbilityIndex
{
Index = 0,
IsHidden = false,
}, 50, 0, Gender.Male, 0, "hardy");
var party = new PokemonPartyImpl(1);
party.SwapInto(pokemon, 0);
var opponentParty = new PokemonPartyImpl(1);
opponentParty.SwapInto(new PokemonImpl(library, species, species.GetDefaultForm(), new AbilityIndex
{
Index = 0,
IsHidden = false,
}, 50, 0, Gender.Male, 0, "hardy"), 0);
var parties = new[]
{
new BattlePartyImpl(party, [new ResponsibleIndex(0, 0)]),
new BattlePartyImpl(opponentParty, [new ResponsibleIndex(1, 0)]),
};
var battle = new BattleImpl(library, parties, false, 2, 1, false, "grass", 0);
return battle.Parties[0].GetBattlePokemon(pokemon)!;
}
[Test]