mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-10 14:44:24 +00:00
Add overload for ITrainerInfo blank fetch
This commit is contained in:
parent
75874b6b81
commit
6e94eaaaee
1 changed files with 12 additions and 0 deletions
|
@ -30,8 +30,20 @@ public static class EntityBlank
|
|||
_ => GetBlank(gen),
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Gets a Blank <see cref="PKM"/> object compatible with the provided inputs.
|
||||
/// </summary>
|
||||
public static PKM GetBlank(ITrainerInfo tr)
|
||||
{
|
||||
if (tr is SaveFile s)
|
||||
return s.BlankPKM;
|
||||
return GetBlank(tr.Generation, tr.Game);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="GetBlank(ITrainerInfo)"/>
|
||||
public static PKM GetBlank(int gen, int ver) => GetBlank(gen, (GameVersion)ver);
|
||||
|
||||
/// <inheritdoc cref="GetBlank(ITrainerInfo)"/>
|
||||
public static PKM GetBlank(int gen)
|
||||
{
|
||||
var type = Type.GetType($"PKHeX.Core.PK{gen}");
|
||||
|
|
Loading…
Reference in a new issue