2018-03-29 01:52:50 +00:00
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
2022-01-04 03:33:10 +00:00
|
|
|
|
public sealed record SimpleTrainerInfo : ITrainerInfo, IRegionOrigin
|
2018-03-29 01:52:50 +00:00
|
|
|
|
{
|
|
|
|
|
public string OT { get; set; } = "PKHeX";
|
2018-04-28 18:06:58 +00:00
|
|
|
|
public int TID { get; set; } = 12345;
|
|
|
|
|
public int SID { get; set; } = 54321;
|
2022-01-04 03:33:10 +00:00
|
|
|
|
public int Gender { get; set; }
|
2018-03-29 01:52:50 +00:00
|
|
|
|
public int Language { get; set; } = (int)LanguageID.English;
|
|
|
|
|
|
2021-08-03 02:43:57 +00:00
|
|
|
|
// IRegionOrigin for generation 6/7
|
|
|
|
|
public byte ConsoleRegion { get; set; } = 1; // North America
|
|
|
|
|
public byte Region { get; set; } = 7; // California
|
|
|
|
|
public byte Country { get; set; } = 49; // USA
|
2018-03-29 01:52:50 +00:00
|
|
|
|
|
2019-11-27 00:55:28 +00:00
|
|
|
|
public int Game { get; }
|
2018-03-29 01:52:50 +00:00
|
|
|
|
public int Generation { get; set; } = PKX.Generation;
|
2019-11-27 00:55:28 +00:00
|
|
|
|
|
|
|
|
|
public SimpleTrainerInfo(GameVersion game = GameVersion.SW)
|
|
|
|
|
{
|
|
|
|
|
Game = (int) game;
|
2022-01-04 03:33:10 +00:00
|
|
|
|
SanityCheckRegionOrigin(game);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SanityCheckRegionOrigin(GameVersion game)
|
|
|
|
|
{
|
2020-08-07 01:24:20 +00:00
|
|
|
|
if (GameVersion.Gen7b.Contains(game) || game.GetGeneration() >= 8)
|
2022-01-04 03:33:10 +00:00
|
|
|
|
this.ClearRegionOrigin();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public SimpleTrainerInfo(ITrainerInfo other) : this((GameVersion)other.Game)
|
|
|
|
|
{
|
|
|
|
|
OT = other.OT;
|
|
|
|
|
TID = other.TID;
|
|
|
|
|
SID = other.SID;
|
|
|
|
|
Gender = other.Gender;
|
|
|
|
|
Language = other.Language;
|
|
|
|
|
Generation = other.Generation;
|
|
|
|
|
|
|
|
|
|
if (other is IRegionOrigin r)
|
|
|
|
|
r.CopyRegionOrigin(this);
|
|
|
|
|
|
|
|
|
|
SanityCheckRegionOrigin((GameVersion)Game);
|
2019-11-27 00:55:28 +00:00
|
|
|
|
}
|
2018-03-29 01:52:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|