mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-24 11:23:11 +00:00
fc754b346b
[Language Reference](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/file-scoped-namespaces) Updates all the files, one less level of indentation. Some small changes were made to API surfaces, renaming `PKM pkm` -> `PKM pk`, and `LegalityAnalysis.pkm` -> `LegalityAnalysis.Entity`
46 lines
1.4 KiB
C#
46 lines
1.4 KiB
C#
namespace PKHeX.Core;
|
|
|
|
public sealed record SimpleTrainerInfo : ITrainerInfo, IRegionOrigin
|
|
{
|
|
public string OT { get; set; } = "PKHeX";
|
|
public int TID { get; set; } = 12345;
|
|
public int SID { get; set; } = 54321;
|
|
public int Gender { get; set; }
|
|
public int Language { get; set; } = (int)LanguageID.English;
|
|
|
|
// 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
|
|
|
|
public int Game { get; }
|
|
public int Generation { get; set; } = PKX.Generation;
|
|
public EntityContext Context { get; set; } = PKX.Context;
|
|
|
|
public SimpleTrainerInfo(GameVersion game = GameVersion.SW)
|
|
{
|
|
Game = (int) game;
|
|
SanityCheckRegionOrigin(game);
|
|
}
|
|
|
|
private void SanityCheckRegionOrigin(GameVersion game)
|
|
{
|
|
if (GameVersion.Gen7b.Contains(game) || game.GetGeneration() >= 8)
|
|
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);
|
|
}
|
|
}
|