mirror of
https://github.com/mm201/pkmn-classic-framework.git
synced 2026-08-01 23:53:39 -05:00
Workaround LAST_INSERT_ID and CAST limitations by making all primary keys unsigned bigint. Workaround LAST_INSERT_ID signed/unsigned inconsistency between 5.5 and 5.6 by using Convert.ToUInt64 instead of casts.
46 lines
1.0 KiB
C#
46 lines
1.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace PkmnFoundations.Structures
|
|
{
|
|
public class BoxRecord4
|
|
{
|
|
public BoxRecord4()
|
|
{
|
|
}
|
|
|
|
public BoxRecord4(int pid, BoxLabels4 label, ulong serial_number, byte[] data)
|
|
{
|
|
if (data.Length != 540) throw new ArgumentException("Box data must be 540 bytes.");
|
|
|
|
PID = pid;
|
|
Label = label;
|
|
SerialNumber = serial_number;
|
|
Data = data;
|
|
}
|
|
|
|
// todo: encapsulate these so calculated fields are always correct
|
|
public int PID;
|
|
public BoxLabels4 Label;
|
|
public ulong SerialNumber;
|
|
public byte[] Data;
|
|
|
|
public BoxRecord4 Clone()
|
|
{
|
|
return new BoxRecord4(PID, Label, SerialNumber, Data.ToArray());
|
|
}
|
|
}
|
|
|
|
public enum BoxLabels4 : int
|
|
{
|
|
Favorite = 0x00,
|
|
Cool = 0x01,
|
|
Cute = 0x02,
|
|
Suggested = 0x03,
|
|
Fun = 0x04,
|
|
Select = 0x05
|
|
}
|
|
}
|