2019-06-09 02:56:11 +00:00
|
|
|
|
using System;
|
2022-01-03 05:35:59 +00:00
|
|
|
|
using static System.Buffers.Binary.BinaryPrimitives;
|
2019-06-09 02:56:11 +00:00
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
|
|
|
|
|
|
public sealed class Situation6 : SaveBlock<SAV6>
|
2019-06-09 02:56:11 +00:00
|
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
|
public Situation6(SAV6 SAV, int offset) : base(SAV) => Offset = offset;
|
2019-06-09 02:56:11 +00:00
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
public int M
|
|
|
|
|
{
|
|
|
|
|
get => ReadUInt16LittleEndian(Data.AsSpan(Offset + 0x02));
|
|
|
|
|
set
|
2019-06-09 02:56:11 +00:00
|
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
|
var span = Data.AsSpan(Offset + 0x02);
|
|
|
|
|
WriteUInt16LittleEndian(span, (ushort)value);
|
|
|
|
|
WriteUInt16LittleEndian(span[0xF4..], (ushort)value);
|
2019-06-09 02:56:11 +00:00
|
|
|
|
}
|
2022-06-18 18:04:24 +00:00
|
|
|
|
}
|
2019-06-09 02:56:11 +00:00
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
public float X
|
|
|
|
|
{
|
|
|
|
|
get => ReadSingleLittleEndian(Data.AsSpan(Offset + 0x10)) / 18;
|
|
|
|
|
set
|
2019-06-09 02:56:11 +00:00
|
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
|
var span = Data.AsSpan(Offset + 0x10);
|
|
|
|
|
WriteSingleLittleEndian(span, value * 18);
|
|
|
|
|
WriteSingleLittleEndian(span[0xF4..], value * 18);
|
2019-06-09 02:56:11 +00:00
|
|
|
|
}
|
2022-06-18 18:04:24 +00:00
|
|
|
|
}
|
2019-06-09 02:56:11 +00:00
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
public float Z
|
|
|
|
|
{
|
2022-08-12 14:58:23 +00:00
|
|
|
|
get => ReadSingleLittleEndian(Data.AsSpan(Offset + 0x14)) / 18;
|
2022-06-18 18:04:24 +00:00
|
|
|
|
set
|
2019-06-09 02:56:11 +00:00
|
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
|
var span = Data.AsSpan(Offset + 0x14);
|
|
|
|
|
WriteSingleLittleEndian(span, value * 18);
|
|
|
|
|
WriteSingleLittleEndian(span[0xF4..], value * 18);
|
2019-06-09 02:56:11 +00:00
|
|
|
|
}
|
2022-06-18 18:04:24 +00:00
|
|
|
|
}
|
2019-06-09 02:56:11 +00:00
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
public float Y
|
|
|
|
|
{
|
|
|
|
|
get => ReadSingleLittleEndian(Data.AsSpan(Offset + 0x18)) / 18;
|
|
|
|
|
set
|
2019-06-09 02:56:11 +00:00
|
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
|
var span = Data.AsSpan(Offset + 0x18);
|
|
|
|
|
WriteSingleLittleEndian(span, value * 18);
|
|
|
|
|
WriteSingleLittleEndian(span[0xF4..], value * 18);
|
2019-06-09 02:56:11 +00:00
|
|
|
|
}
|
2022-06-18 18:04:24 +00:00
|
|
|
|
}
|
2019-06-09 02:56:11 +00:00
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
// xy only
|
|
|
|
|
public int Style
|
|
|
|
|
{
|
|
|
|
|
get => Data[Offset + 0x14D];
|
|
|
|
|
set => Data[Offset + 0x14D] = (byte)value;
|
2019-06-09 02:56:11 +00:00
|
|
|
|
}
|
2022-01-03 05:35:59 +00:00
|
|
|
|
}
|