Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user