Allow SaveFile constructor to specify exportable state

Useful for partially-supported savefiles that can't be exported yet (Stadium)
This commit is contained in:
Kurt 2020-09-30 12:44:50 -07:00
parent eb6c570695
commit 769d5d8689
2 changed files with 6 additions and 6 deletions

View file

@ -70,7 +70,7 @@ namespace PKHeX.Core
public SAV1Stadium(byte[] data) : this(data, IsStadiumJ(data)) { } public SAV1Stadium(byte[] data) : this(data, IsStadiumJ(data)) { }
public SAV1Stadium(byte[] data, bool japanese) : base(data) public SAV1Stadium(byte[] data, bool japanese) : base(data, false)
{ {
Japanese = japanese; Japanese = japanese;
Box = 0; Box = 0;
@ -113,7 +113,7 @@ namespace PKHeX.Core
for (int i = 0; i < 10; i++) for (int i = 0; i < 10; i++)
{ {
if (BitConverter.ToUInt32(data, 0x15A + (i * SAV1Stadium.TeamSizeU)) != 0x454B4F50) // POKE if (BitConverter.ToUInt32(data, 0x15A + (i * TeamSizeU)) != 0x454B4F50) // POKE
return false; return false;
} }
return true; return true;
@ -126,7 +126,7 @@ namespace PKHeX.Core
for (int i = 0; i < 10; i++) for (int i = 0; i < 10; i++)
{ {
if (BitConverter.ToUInt32(data, 0x122 + (i * SAV1Stadium.TeamSizeJ)) != 0x454B4F50) // POKE if (BitConverter.ToUInt32(data, 0x122 + (i * TeamSizeJ)) != 0x454B4F50) // POKE
return false; return false;
} }
return true; return true;

View file

@ -16,14 +16,14 @@ namespace PKHeX.Core
public readonly bool Exportable; public readonly bool Exportable;
public readonly byte[] BAK; public readonly byte[] BAK;
protected SaveFile(byte[] data, byte[] bak) protected SaveFile(byte[] data, byte[] bak, bool exportable = true)
{ {
Data = data; Data = data;
BAK = bak; BAK = bak;
Exportable = true; Exportable = exportable;
} }
protected SaveFile(byte[] data) : this(data, (byte[])data.Clone()) { } protected SaveFile(byte[] data, bool exportable = true) : this(data, (byte[])data.Clone(), exportable) { }
protected SaveFile() protected SaveFile()
{ {