mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 12:33:06 +00:00
Add NextOpenBoxSlot fetch for empty slot overwrites
< 0 is storage full
This commit is contained in:
parent
2d75e93ef0
commit
f9eb1746ea
1 changed files with 17 additions and 0 deletions
|
@ -830,6 +830,23 @@ namespace PKHeX.Core
|
|||
|
||||
public virtual bool IsPKMPresent(int Offset) => PKX.IsPKMPresent(Data, Offset);
|
||||
|
||||
public bool IsStorageFull => NextOpenBoxSlot < 0;
|
||||
|
||||
public int NextOpenBoxSlot
|
||||
{
|
||||
get
|
||||
{
|
||||
int count = BoxSlotCount * BoxCount;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
int offset = GetBoxSlotOffset(i);
|
||||
if (!IsPKMPresent(offset))
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract string GetString(byte[] data, int offset, int length);
|
||||
public string GetString(int offset, int length) => GetString(Data, offset, length);
|
||||
public abstract byte[] SetString(string value, int maxLength, int PadToSize = 0, ushort PadWith = 0);
|
||||
|
|
Loading…
Reference in a new issue