mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-08 16:55:51 -05:00
Misc simplifications
reference shared base class reorder arguments to match pk1, remove extra space
This commit is contained in:
@@ -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) { }
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user