mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-30 15:59:13 +00:00
e373db99c1
byte 6 sets 0/1/2/3, which is used for the editor byte 5 says which sub-table to use (0/1/2) if there is something on the tree. Closes #1283
37 lines
1.2 KiB
C#
37 lines
1.2 KiB
C#
using System;
|
|
|
|
namespace PKHeX.Core
|
|
{
|
|
public class HoneyTree
|
|
{
|
|
public const int Size = 8;
|
|
|
|
public readonly byte[] Data;
|
|
|
|
public uint Time { get => BitConverter.ToUInt32(Data, 0); set => BitConverter.GetBytes(value).CopyTo(Data, 0); }
|
|
public int Slot { get => Data[4]; set => Data[4] = (byte)value; }
|
|
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); } }
|
|
public int Shake { get => Data[7]; set => Data[7] = (byte)value; }
|
|
|
|
public HoneyTree(byte[] data)
|
|
{
|
|
Data = data;
|
|
}
|
|
|
|
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},
|
|
};
|
|
public static readonly int[][] TablePt =
|
|
{
|
|
TableDP[0],
|
|
new[] {415, 265, 412, 420, 190, 190},
|
|
new[] {412, 420, 415, 190, 190, 214},
|
|
TableDP[3],
|
|
};
|
|
}
|
|
}
|