2019-09-23 23:56:47 +00:00
|
|
|
|
using System;
|
2022-01-03 05:35:59 +00:00
|
|
|
|
using static System.Buffers.Binary.BinaryPrimitives;
|
2019-09-23 23:56:47 +00:00
|
|
|
|
|
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
|
|
|
|
public sealed class Misc8 : SaveBlock
|
|
|
|
|
{
|
2019-11-16 01:34:18 +00:00
|
|
|
|
public Misc8(SAV8SWSH sav, SCBlock block) : base(sav, block.Data) { }
|
|
|
|
|
|
|
|
|
|
public int Badges
|
|
|
|
|
{
|
|
|
|
|
get => Data[Offset + 0x00];
|
|
|
|
|
set => Data[Offset + 0x00] = (byte)value;
|
|
|
|
|
}
|
2019-09-23 23:56:47 +00:00
|
|
|
|
|
|
|
|
|
public uint Money
|
|
|
|
|
{
|
2022-01-03 05:35:59 +00:00
|
|
|
|
get => ReadUInt32LittleEndian(Data.AsSpan(Offset + 0x04));
|
2019-09-23 23:56:47 +00:00
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value > 9999999)
|
|
|
|
|
value = 9999999;
|
2022-01-03 05:35:59 +00:00
|
|
|
|
WriteUInt32LittleEndian(Data.AsSpan(Offset + 0x04), value);
|
2019-09-23 23:56:47 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-16 01:34:18 +00:00
|
|
|
|
public int BP
|
|
|
|
|
{
|
2022-01-03 05:35:59 +00:00
|
|
|
|
get => ReadUInt16LittleEndian(Data.AsSpan(Offset + 0x11C));
|
|
|
|
|
set => WriteUInt16LittleEndian(Data.AsSpan(Offset + 0x11C), (ushort)value);
|
2019-11-16 01:34:18 +00:00
|
|
|
|
}
|
2019-09-23 23:56:47 +00:00
|
|
|
|
}
|
|
|
|
|
}
|