PKHeX/PKHeX.Core/Saves/Substructures/Gen6/Situation6.cs
Kurt 1b028198ad
Split gen5-7 saves with inheritance (#2319)
refer to pull request comments for summary
2019-06-08 19:56:11 -07:00

60 lines
No EOL
1.6 KiB
C#

using System;
namespace PKHeX.Core
{
public 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;
}
}
}