Misc simplifications

reference shared base class
reorder arguments to match pk1, remove extra space
This commit is contained in:
Kurt
2018-09-12 20:55:30 -07:00
parent fc91819410
commit 930d07c080
2 changed files with 3 additions and 3 deletions

View File

@@ -3,11 +3,11 @@ 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) { IsEgg = egg, otname = otname, nick = nick };
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(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) { }

View File

@@ -51,7 +51,7 @@ private byte[] GetEmptyList(PokeListType c, bool jp = false)
private int GetOffsetPKMOT(int base_ofs, int i) => GetOffsetPKMData(base_ofs, Capacity) + (StringLength * i);
private int GetOffsetPKMNickname(int base_ofs, int i) => GetOffsetPKMOT(base_ofs, Capacity) + (StringLength * i);
private static int GetStringLength(bool jp) => jp ? PK1.STRLEN_J : PK1.STRLEN_U;
private static int GetStringLength(bool jp) => jp ? _K12.STRLEN_J : _K12.STRLEN_U;
protected bool IsFormatParty => IsCapacityPartyFormat((PokeListType)Capacity);
protected static bool IsCapacityPartyFormat(PokeListType Capacity) => Capacity == PokeListType.Single || Capacity == PokeListType.Party;