mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-05-24 03:56:13 -05:00
All logic in PokeCrypto is separate from the rest of the PKHeX.Core library; makes it easy to just rip this portion out and reuse in other projects without needing the entirety of PKHeX.Core logic optimize out the CheckEncrypted to the actual path, separate methods. Only usages of this method were with hardcoded Format values, so no impact
17 lines
1.0 KiB
C#
17 lines
1.0 KiB
C#
namespace PKHeX.Core
|
|
{
|
|
public sealed class PokeList2 : PokeListGB<PK2>
|
|
{
|
|
protected override byte GetSpeciesBoxIdentifier(PK2 pk) => pk.IsEgg ? (byte)0xFD : (byte)pk.Species;
|
|
protected override PK2 GetEntry(byte[] dat, byte[] otname, byte[] nick, bool egg) => new PK2(dat) { otname = otname, nick = nick, IsEgg = egg };
|
|
protected override int GetEntrySize() => GetEntrySize(IsFormatParty);
|
|
|
|
public PokeList2(byte[] d, PokeListType c = PokeListType.Single, bool jp = false) : base(d, c, jp) { }
|
|
public PokeList2(PokeListType c = PokeListType.Single, bool jp = false) : base(c, jp) { }
|
|
public PokeList2(byte[] d) : base(d, PokeListType.Single, d.Length == PokeCrypto.SIZE_2JLIST) { }
|
|
public PokeList2(PK2 pk) : base(pk) { }
|
|
|
|
private static int GetEntrySize(bool party) => party ? PokeCrypto.SIZE_2PARTY : PokeCrypto.SIZE_2STORED;
|
|
public static int GetDataLength(PokeListType c, bool jp) => GetDataSize(c, jp, GetEntrySize(IsCapacityPartyFormat(c)));
|
|
}
|
|
} |