2
0
Fork 0
mirror of https://github.com/kwsch/PKHeX synced 2024-12-28 13:23:10 +00:00
PKHeX/PKHeX.Core/Saves/Substructures/Gen6/Situation6.cs

60 lines
1.6 KiB
C#
Raw Normal View History

using System;
namespace PKHeX.Core
{
public sealed class Situation6 : SaveBlock
{
public Situation6(SaveFile SAV, int offset) : base(SAV) => Offset = offset;
public int M
{
get => BitConverter.ToUInt16(Data, Offset + 0x02);
set
{
var val = BitConverter.GetBytes((ushort)value);
val.CopyTo(Data, Offset + 0x02);
val.CopyTo(Data, Offset + 0x02 + 0xF4);
}
}
public float X
{
get => BitConverter.ToSingle(Data, Offset + 0x10) / 18;
set
{
var val = BitConverter.GetBytes(value * 18);
val.CopyTo(Data, Offset + 0x10);
val.CopyTo(Data, Offset + 0x10 + 0xF4);
}
}
public float Z
{
get => BitConverter.ToSingle(Data, Offset + 0x14);
set
{
var val = BitConverter.GetBytes(value);
val.CopyTo(Data, Offset + 0x14);
val.CopyTo(Data, Offset + 0x14 + 0xF4);
}
}
public float Y
{
get => BitConverter.ToSingle(Data, Offset + 0x18) / 18;
set
{
var val = BitConverter.GetBytes(value * 18);
val.CopyTo(Data, Offset + 0x18);
val.CopyTo(Data, Offset + 0x18 + 0xF4);
}
}
// xy only
public int Style
{
get => Data[Offset + 0x14D];
set => Data[Offset + 0x14D] = (byte)value;
}
}
}