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

@@ -11,7 +11,7 @@ public class Gen7MiscLibrary : IMiscLibrary
new SecondaryEffectImpl(-1, "struggle", new Dictionary<StringKey, object?>()), ["not_sketchable"]);
/// <inheritdoc />
public ITurnChoice ReplacementChoice(IPokemon user, byte targetSide, byte targetPosition) =>
public ITurnChoice ReplacementChoice(IBattlePokemon user, byte targetSide, byte targetPosition) =>
new MoveChoice(user, new LearnedMoveImpl(_struggleData, MoveLearnMethod.Unknown), targetSide, targetPosition);
/// <inheritdoc />
@@ -37,7 +37,7 @@ public class Gen7MiscLibrary : IMiscLibrary
public bool CanFlee(IBattle battle, IFleeChoice fleeChoice)
{
var user = fleeChoice.User;
var battleData = user.BattleData;
var battleData = user;
if (battleData == null)
return false;
var opponentSide = battle.Sides[battleData.SideIndex == 0 ? 1 : 0];