PKHeX/PKHeX.Core/PKM/Shared/PokeList2.cs
Kurt 930d07c080 Misc simplifications
reference shared base class
reorder arguments to match pk1, remove extra space
2018-09-12 20:55:30 -07:00

17 lines
1013 B
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 == PKX.SIZE_2JLIST) { }
public PokeList2(PK2 pk) : base(pk) { }
private static int GetEntrySize(bool party) => party ? PKX.SIZE_2PARTY : PKX.SIZE_2STORED;
public static int GetDataLength(PokeListType c, bool jp) => GetDataSize(c, jp, GetEntrySize(IsCapacityPartyFormat(c)));
}
}