2017-01-08 07:54:09 +00:00
|
|
|
|
namespace PKHeX.Core
|
2016-10-29 22:41:55 +00:00
|
|
|
|
{
|
2017-10-24 06:12:58 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Utility class for <see cref="GameVersion"/> logic.
|
|
|
|
|
/// </summary>
|
2016-10-29 22:41:55 +00:00
|
|
|
|
public static class GameUtil
|
|
|
|
|
{
|
|
|
|
|
/// <summary>Determines the Version Grouping of an input Version ID</summary>
|
|
|
|
|
/// <param name="Version">Version of which to determine the group</param>
|
|
|
|
|
/// <returns>Version Group Identifier or Invalid if type cannot be determined.</returns>
|
2017-06-18 01:37:19 +00:00
|
|
|
|
public static GameVersion GetMetLocationVersionGroup(GameVersion Version)
|
2016-10-29 22:41:55 +00:00
|
|
|
|
{
|
|
|
|
|
switch (Version)
|
|
|
|
|
{
|
|
|
|
|
case GameVersion.CXD:
|
|
|
|
|
return GameVersion.CXD;
|
|
|
|
|
|
2017-01-25 11:29:38 +00:00
|
|
|
|
case GameVersion.GO:
|
|
|
|
|
return GameVersion.GO;
|
|
|
|
|
|
2016-10-29 22:41:55 +00:00
|
|
|
|
case GameVersion.RBY:
|
2017-01-25 11:29:38 +00:00
|
|
|
|
case GameVersion.RD:
|
|
|
|
|
case GameVersion.BU:
|
|
|
|
|
case GameVersion.YW:
|
|
|
|
|
case GameVersion.GN:
|
2016-10-29 22:41:55 +00:00
|
|
|
|
return GameVersion.RBY;
|
|
|
|
|
|
|
|
|
|
case GameVersion.GS:
|
2017-02-26 17:36:53 +00:00
|
|
|
|
case GameVersion.GD:
|
|
|
|
|
case GameVersion.SV:
|
2016-10-29 22:41:55 +00:00
|
|
|
|
case GameVersion.C:
|
|
|
|
|
return GameVersion.GSC;
|
|
|
|
|
|
|
|
|
|
case GameVersion.R:
|
|
|
|
|
case GameVersion.S:
|
|
|
|
|
return GameVersion.RS;
|
|
|
|
|
|
|
|
|
|
case GameVersion.E:
|
|
|
|
|
return GameVersion.E;
|
|
|
|
|
|
|
|
|
|
case GameVersion.FR:
|
|
|
|
|
case GameVersion.LG:
|
|
|
|
|
return GameVersion.FR;
|
|
|
|
|
|
|
|
|
|
case GameVersion.D:
|
|
|
|
|
case GameVersion.P:
|
|
|
|
|
return GameVersion.DP;
|
|
|
|
|
|
|
|
|
|
case GameVersion.Pt:
|
|
|
|
|
return GameVersion.Pt;
|
|
|
|
|
|
|
|
|
|
case GameVersion.HG:
|
|
|
|
|
case GameVersion.SS:
|
|
|
|
|
return GameVersion.HGSS;
|
|
|
|
|
|
|
|
|
|
case GameVersion.B:
|
|
|
|
|
case GameVersion.W:
|
|
|
|
|
return GameVersion.BW;
|
|
|
|
|
|
|
|
|
|
case GameVersion.B2:
|
|
|
|
|
case GameVersion.W2:
|
|
|
|
|
return GameVersion.B2W2;
|
|
|
|
|
|
|
|
|
|
case GameVersion.X:
|
|
|
|
|
case GameVersion.Y:
|
|
|
|
|
return GameVersion.XY;
|
|
|
|
|
|
|
|
|
|
case GameVersion.OR:
|
|
|
|
|
case GameVersion.AS:
|
|
|
|
|
return GameVersion.ORAS;
|
|
|
|
|
|
|
|
|
|
case GameVersion.SN:
|
|
|
|
|
case GameVersion.MN:
|
|
|
|
|
return GameVersion.SM;
|
|
|
|
|
|
2017-09-02 15:41:36 +00:00
|
|
|
|
case GameVersion.US:
|
|
|
|
|
case GameVersion.UM:
|
|
|
|
|
return GameVersion.USUM;
|
|
|
|
|
|
2016-10-29 22:41:55 +00:00
|
|
|
|
default:
|
|
|
|
|
return GameVersion.Invalid;
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-01-14 21:10:36 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a Version ID from the end of that Generation
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="generation">Generation ID</param>
|
|
|
|
|
/// <returns>Version ID from requested generation. If none, return Unknown.</returns>
|
2017-06-18 01:37:19 +00:00
|
|
|
|
public static GameVersion GetVersion(int generation)
|
2017-01-14 21:10:36 +00:00
|
|
|
|
{
|
|
|
|
|
switch (generation)
|
|
|
|
|
{
|
|
|
|
|
case 1: return GameVersion.RBY;
|
|
|
|
|
case 2: return GameVersion.C;
|
|
|
|
|
case 3: return GameVersion.E;
|
|
|
|
|
case 4: return GameVersion.SS;
|
|
|
|
|
case 5: return GameVersion.W2;
|
|
|
|
|
case 6: return GameVersion.AS;
|
|
|
|
|
case 7: return GameVersion.MN;
|
|
|
|
|
default:
|
|
|
|
|
return GameVersion.Unknown;
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-10-29 22:41:55 +00:00
|
|
|
|
}
|
|
|
|
|
}
|