Add jp vc gen2 sizes

so many so consistent
This commit is contained in:
Kurt 2018-01-25 18:30:09 -08:00
parent 4aea1b3a35
commit 4c93183575

View file

@ -32,22 +32,27 @@ namespace PKHeX.Core
public const int SIZE_G3RAW = 0x20000;
public const int SIZE_G3RAWHALF = 0x10000;
public const int SIZE_G2RAW_U = 0x8000;
public const int SIZE_G2VC = 0x8010;
public const int SIZE_G2VC_U = 0x8010;
public const int SIZE_G2BAT_U = 0x802C;
public const int SIZE_G2EMU_U = 0x8030;
public const int SIZE_G2RAW_J = 0x10000;
public const int SIZE_G2VC_J = 0x10010;
public const int SIZE_G2BAT_J = 0x1002C;
public const int SIZE_G2EMU_J = 0x10030;
public const int SIZE_G1RAW = 0x8000;
public const int SIZE_G1BAT = 0x802C;
private static readonly HashSet<int> SIZES = new HashSet<int>
private static readonly HashSet<int> SIZES_2 = new HashSet<int>
{
SIZE_G2RAW_U, SIZE_G2VC_U, SIZE_G2BAT_U, SIZE_G2EMU_U, SIZE_G2RAW_J, SIZE_G2BAT_J, SIZE_G2EMU_J, SIZE_G2VC_J,
};
private static readonly HashSet<int> SIZES = new HashSet<int>(SIZES_2)
{
SIZE_G7SM, SIZE_G7USUM,
SIZE_G6XY, SIZE_G6ORAS, SIZE_G6ORASDEMO,
SIZE_G5RAW, SIZE_G5BW, SIZE_G5B2W2,
SIZE_G4BR, SIZE_G4RAW,
SIZE_G3BOX, SIZE_G3BOXGCI, SIZE_G3COLO, SIZE_G3COLOGCI, SIZE_G3XD, SIZE_G3XDGCI, SIZE_G3RAW, SIZE_G3RAWHALF,
SIZE_G2RAW_U, SIZE_G2VC, SIZE_G2BAT_U, SIZE_G2EMU_U, SIZE_G2RAW_J, SIZE_G2BAT_J, SIZE_G2EMU_J,
// SIZES_2 covers gen2 sizes since there's so many
SIZE_G1RAW, SIZE_G1BAT
};
@ -133,7 +138,7 @@ namespace PKHeX.Core
/// <returns>Version Identifier or Invalid if type cannot be determined.</returns>
internal static GameVersion GetIsG2SAV(byte[] data)
{
if (!new[] {SIZE_G2RAW_J, SIZE_G2RAW_U, SIZE_G2BAT_J, SIZE_G2BAT_U, SIZE_G2EMU_U, SIZE_G2EMU_J, SIZE_G2VC}.Contains(data.Length))
if (!SIZES_2.Contains(data.Length))
return GameVersion.Invalid;
// Check if it's not an american save or a japanese save