2017-04-07 04:47:28 +00:00
|
|
|
|
using System;
|
2022-01-03 05:35:59 +00:00
|
|
|
|
using static System.Buffers.Binary.BinaryPrimitives;
|
2017-04-07 04:47:28 +00:00
|
|
|
|
|
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
2019-09-03 02:30:58 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Honey Tree in Sinnoh (Gen4)
|
|
|
|
|
/// </summary>
|
2021-08-05 22:18:43 +00:00
|
|
|
|
public sealed class HoneyTreeValue
|
2017-04-07 04:47:28 +00:00
|
|
|
|
{
|
|
|
|
|
public const int Size = 8;
|
|
|
|
|
|
|
|
|
|
public readonly byte[] Data;
|
|
|
|
|
|
2022-01-03 05:35:59 +00:00
|
|
|
|
public uint Time { get => ReadUInt32LittleEndian(Data.AsSpan(0)); set => WriteUInt32LittleEndian(Data.AsSpan(0), value); }
|
2017-05-13 03:32:36 +00:00
|
|
|
|
public int Slot { get => Data[4]; set => Data[4] = (byte)value; }
|
2017-06-29 16:09:59 +00:00
|
|
|
|
public int SubTable { get => Data[5]; set => Data[5] = (byte)value; } // offset by 1 with respect to Group
|
|
|
|
|
public int Group { get => Data[6]; set { Data[6] = (byte)value; SubTable = Math.Max(0, Group - 1); } }
|
2017-05-13 03:32:36 +00:00
|
|
|
|
public int Shake { get => Data[7]; set => Data[7] = (byte)value; }
|
2017-04-07 04:47:28 +00:00
|
|
|
|
|
2021-08-05 22:18:43 +00:00
|
|
|
|
public HoneyTreeValue(byte[] data)
|
2017-04-07 04:47:28 +00:00
|
|
|
|
{
|
|
|
|
|
Data = data;
|
|
|
|
|
}
|
2018-05-12 15:13:39 +00:00
|
|
|
|
|
2017-04-07 04:47:28 +00:00
|
|
|
|
public static readonly int[][] TableDP =
|
|
|
|
|
{
|
|
|
|
|
new[] {000, 000, 000, 000, 000, 000},
|
|
|
|
|
new[] {265, 266, 415, 412, 420, 190},
|
|
|
|
|
new[] {415, 412, 420, 190, 214, 265},
|
|
|
|
|
new[] {446, 446, 446, 446, 446, 446},
|
|
|
|
|
};
|
2018-07-29 20:27:48 +00:00
|
|
|
|
|
2017-04-07 04:47:28 +00:00
|
|
|
|
public static readonly int[][] TablePt =
|
|
|
|
|
{
|
|
|
|
|
TableDP[0],
|
|
|
|
|
new[] {415, 265, 412, 420, 190, 190},
|
|
|
|
|
new[] {412, 420, 415, 190, 190, 214},
|
|
|
|
|
TableDP[3],
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|