mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 12:33:06 +00:00
2ea1fea5f5
add GameVersion to generation fix generating pk2 eggs relocate some logic
55 lines
No EOL
1.4 KiB
C#
55 lines
No EOL
1.4 KiB
C#
namespace PKHeX.Core
|
|
{
|
|
/// <summary>
|
|
/// Minimal Trainer Information necessary for generating a <see cref="PKM"/>.
|
|
/// </summary>
|
|
public interface ITrainerInfo
|
|
{
|
|
string OT { get; }
|
|
ushort TID { get; }
|
|
ushort SID { get; }
|
|
int Gender { get; }
|
|
int Game { get; }
|
|
int Language { get; }
|
|
|
|
int Country { get; }
|
|
int SubRegion { get; }
|
|
int ConsoleRegion { get; }
|
|
|
|
int Generation { get; }
|
|
}
|
|
|
|
public static partial class Extensions
|
|
{
|
|
public static void ApplyToPKM(this ITrainerInfo info, PKM pk)
|
|
{
|
|
pk.OT_Name = info.OT;
|
|
pk.TID = info.TID;
|
|
pk.SID = info.SID;
|
|
pk.OT_Gender = info.Gender;
|
|
pk.Language = info.Language;
|
|
pk.Version = info.Game;
|
|
|
|
pk.Country = info.Country;
|
|
pk.Region = info.SubRegion;
|
|
pk.ConsoleRegion = info.ConsoleRegion;
|
|
}
|
|
|
|
public static void ApplyHandlingTrainerInfo(this ITrainerInfo SAV, PKM pk)
|
|
{
|
|
if (pk.Format == SAV.Generation)
|
|
return;
|
|
|
|
pk.HT_Name = SAV.OT;
|
|
pk.HT_Gender = SAV.Gender;
|
|
pk.HT_Friendship = pk.OT_Friendship;
|
|
pk.CurrentHandler = 1;
|
|
|
|
if (SAV.Generation == 6)
|
|
{
|
|
pk.Geo1_Country = SAV.Country;
|
|
pk.Geo1_Region = SAV.SubRegion;
|
|
}
|
|
}
|
|
}
|
|
} |