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
|
|
|
|
|
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
2019-10-04 02:09:02 +00:00
|
|
|
|
public sealed class Situation6 : SaveBlock
|
2019-06-09 02:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
public Situation6(SaveFile SAV, int offset) : base(SAV) => Offset = offset;
|
|
|
|
|
|
|
|
|
|
public int M
|
|
|
|
|
{
|
2022-01-03 05:35:59 +00:00
|
|
|
|
get => ReadUInt16LittleEndian(Data.AsSpan(Offset + 0x02));
|
2019-06-09 02:56:11 +00:00
|
|
|
|
set
|
|
|
|
|
{
|
2022-01-03 05:35:59 +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
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public float X
|
|
|
|
|
{
|
2022-01-03 05:35:59 +00:00
|
|
|
|
get => ReadSingleLittleEndian(Data.AsSpan(Offset + 0x10)) / 18;
|
2019-06-09 02:56:11 +00:00
|
|
|
|
set
|
|
|
|
|
{
|
2022-01-03 05:35:59 +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
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public float Z
|
|
|
|
|
{
|
2022-01-03 05:35:59 +00:00
|
|
|
|
get => ReadSingleLittleEndian(Data.AsSpan(Offset + 0x14));
|
2019-06-09 02:56:11 +00:00
|
|
|
|
set
|
|
|
|
|
{
|
2022-01-03 05:35:59 +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
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public float Y
|
|
|
|
|
{
|
2022-01-03 05:35:59 +00:00
|
|
|
|
get => ReadSingleLittleEndian(Data.AsSpan(Offset + 0x18)) / 18;
|
2019-06-09 02:56:11 +00:00
|
|
|
|
set
|
|
|
|
|
{
|
2022-01-03 05:35:59 +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
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// xy only
|
|
|
|
|
public int Style
|
|
|
|
|
{
|
|
|
|
|
get => Data[Offset + 0x14D];
|
|
|
|
|
set => Data[Offset + 0x14D] = (byte)value;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-01-03 05:35:59 +00:00
|
|
|
|
}
|