mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-10 14:44:24 +00:00
parent
a287efe3a1
commit
a5d1bf7900
2 changed files with 7 additions and 6 deletions
|
@ -48,9 +48,9 @@ namespace PKHeX.Core
|
|||
public override PKM Clone() => new BK4((byte[])Data.Clone());
|
||||
|
||||
// Structure
|
||||
public override uint PID { get => ReadUInt16BigEndian(Data.AsSpan(0x00)); set => WriteUInt32BigEndian(Data.AsSpan(0x00), value); }
|
||||
public override ushort Sanity { get => ReadUInt16BigEndian(Data.AsSpan(0x04)); set => WriteUInt32BigEndian(Data.AsSpan(0x04), value); }
|
||||
public override ushort Checksum { get => ReadUInt16BigEndian(Data.AsSpan(0x06)); set => WriteUInt32BigEndian(Data.AsSpan(0x06), value); }
|
||||
public override uint PID { get => ReadUInt32BigEndian(Data.AsSpan(0x00)); set => WriteUInt32BigEndian(Data.AsSpan(0x00), value); }
|
||||
public override ushort Sanity { get => ReadUInt16BigEndian(Data.AsSpan(0x04)); set => WriteUInt16BigEndian(Data.AsSpan(0x04), value); }
|
||||
public override ushort Checksum { get => ReadUInt16BigEndian(Data.AsSpan(0x06)); set => WriteUInt16BigEndian(Data.AsSpan(0x06), value); }
|
||||
|
||||
#region Block A
|
||||
public override int Species { get => ReadUInt16BigEndian(Data.AsSpan(0x08)); set => WriteUInt16BigEndian(Data.AsSpan(0x08), (ushort)value); }
|
||||
|
|
|
@ -36,9 +36,10 @@ namespace PKHeX.Core
|
|||
var span = data[Offset..];
|
||||
for (int i = 0; i < Items.Length; i++)
|
||||
{
|
||||
var item = span.Slice(i * 4, 4);
|
||||
WriteUInt32BigEndian(item, (ushort)Items[i].Index);
|
||||
WriteUInt32BigEndian(item[2..], (ushort)Items[i].Count);
|
||||
var item = Items[i];
|
||||
var slice = span.Slice(i * 4, 4);
|
||||
WriteUInt16BigEndian(slice, (ushort)item.Index);
|
||||
WriteUInt16BigEndian(slice[2..], (ushort)item.Count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue