PKHeX/PKHeX.Core/PKM/HOME/IGameDataSide.cs
Kurt 5bcccc6d92
HOME 2.0.0: Handle conversion behavior & restrictions (#3506)
* Revises legality checks to account for traveling between the three game islands (PLA/BDSP/SWSH)
* Adds conversion mechanisms between the three formats, as well as flexible conversion options to backfill missing data (thanks GameFreak/ILCA for opting for lossy conversion instead of updating the games).
* Adds API abstractions for HOME data storage format (EKH/PKH format 1, aka EH1/PH1).
* Revises some APIs for better usage:
  - `PKM` now exposes a `Context` to indicate the isolation context for legality purposes.
  - Some method signatures have changed to accept `Context` or `GameVersion` instead of a vague `int` for Generation.
  - Evolution History is now tracked in the Legality parse for specific contexts, rather than only per generation.
2022-05-30 21:43:52 -07:00

29 lines
1.4 KiB
C#

namespace PKHeX.Core;
public interface IGameDataSide
{
int Move1 { get; set; } int Move1_PP { get; set; } int Move1_PPUps { get; set; } int RelearnMove1 { get; set; }
int Move2 { get; set; } int Move2_PP { get; set; } int Move2_PPUps { get; set; } int RelearnMove2 { get; set; }
int Move3 { get; set; } int Move3_PP { get; set; } int Move3_PPUps { get; set; } int RelearnMove3 { get; set; }
int Move4 { get; set; } int Move4_PP { get; set; } int Move4_PPUps { get; set; } int RelearnMove4 { get; set; }
int Ball { get; set; }
int Met_Location { get; set; }
int Egg_Location { get; set; }
PersonalInfo GetPersonalInfo(int species, int form);
PKM ConvertToPKM(PKH pkh);
}
public static class GameDataSideExtensions
{
public static void CopyTo(this IGameDataSide data, PKM pk)
{
pk.Move1 = data.Move1; pk.Move1_PP = data.Move1_PP; pk.Move1_PPUps = data.Move1_PPUps; pk.RelearnMove1 = data.RelearnMove1;
pk.Move2 = data.Move2; pk.Move2_PP = data.Move1_PP; pk.Move2_PPUps = data.Move2_PPUps; pk.RelearnMove2 = data.RelearnMove2;
pk.Move3 = data.Move3; pk.Move3_PP = data.Move1_PP; pk.Move3_PPUps = data.Move3_PPUps; pk.RelearnMove3 = data.RelearnMove3;
pk.Move4 = data.Move4; pk.Move4_PP = data.Move1_PP; pk.Move4_PPUps = data.Move4_PPUps; pk.RelearnMove4 = data.RelearnMove4;
pk.Ball = data.Ball;
pk.Met_Location = data.Met_Location;
pk.Egg_Location = data.Egg_Location;
}
}