2019-03-16 23:48:38 +00:00
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <see cref="GameVersion"/> analogues used by Colosseum/XD instead of the main-series values.
|
|
|
|
|
/// </summary>
|
2020-09-06 17:53:13 +00:00
|
|
|
|
#pragma warning disable CA1027 // Mark enums with FlagsAttribute
|
2019-05-30 05:40:07 +00:00
|
|
|
|
public enum GCVersion : byte
|
2020-09-06 17:53:13 +00:00
|
|
|
|
#pragma warning restore CA1027 // Mark enums with FlagsAttribute
|
2019-03-16 23:48:38 +00:00
|
|
|
|
{
|
|
|
|
|
None = 0,
|
|
|
|
|
FR = 1,
|
|
|
|
|
LG = 2,
|
|
|
|
|
S = 8,
|
|
|
|
|
R = 9,
|
|
|
|
|
E = 10,
|
|
|
|
|
CXD = 11,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class GCVersionExtensions
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Translates a main-series <see cref="GameVersion"/> to the corresponding <see cref="GCVersion"/> value.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="gbaVersion">Version ID while present in the main-series games</param>
|
|
|
|
|
/// <returns>Version ID while present in the GameCube games</returns>
|
2021-01-02 01:08:49 +00:00
|
|
|
|
public static GCVersion GetCXDVersionID(this GameVersion gbaVersion) => gbaVersion switch
|
2019-03-16 23:48:38 +00:00
|
|
|
|
{
|
2021-01-02 01:08:49 +00:00
|
|
|
|
GameVersion.S => GCVersion.S,
|
|
|
|
|
GameVersion.R => GCVersion.R,
|
|
|
|
|
GameVersion.E => GCVersion.E,
|
|
|
|
|
GameVersion.FR => GCVersion.FR,
|
|
|
|
|
GameVersion.LG => GCVersion.LG,
|
|
|
|
|
GameVersion.CXD => GCVersion.CXD,
|
|
|
|
|
_ => GCVersion.None,
|
|
|
|
|
};
|
2019-03-16 23:48:38 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Translates a <see cref="GCVersion"/> to the corresponding main-series <see cref="GameVersion"/> value.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="gcVersion">Version ID while present in the GameCube games</param>
|
|
|
|
|
/// <returns>Version ID while present in the main-series games</returns>
|
2021-01-02 01:08:49 +00:00
|
|
|
|
public static GameVersion GetG3VersionID(this GCVersion gcVersion) => gcVersion switch
|
2019-03-16 23:48:38 +00:00
|
|
|
|
{
|
2021-01-02 01:08:49 +00:00
|
|
|
|
GCVersion.S => GameVersion.S,
|
|
|
|
|
GCVersion.R => GameVersion.R,
|
|
|
|
|
GCVersion.E => GameVersion.E,
|
|
|
|
|
GCVersion.FR => GameVersion.FR,
|
|
|
|
|
GCVersion.LG => GameVersion.LG,
|
|
|
|
|
GCVersion.CXD => GameVersion.CXD,
|
2021-08-20 20:49:20 +00:00
|
|
|
|
_ => GameVersion.Unknown,
|
2021-01-02 01:08:49 +00:00
|
|
|
|
};
|
2019-03-16 23:48:38 +00:00
|
|
|
|
}
|
|
|
|
|
}
|