mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-24 03:13:18 +00:00
f1264a1a97
Closes #3445
26 lines
586 B
C#
26 lines
586 B
C#
namespace PKHeX.Core;
|
|
|
|
public enum TurnActionCode
|
|
{
|
|
None = 0,
|
|
Fight = 1,
|
|
Switch = 3,
|
|
Run = 4,
|
|
UNK5 = 5,
|
|
Rotate = 6,
|
|
UNK7 = 7,
|
|
MegaEvolve = 8,
|
|
}
|
|
|
|
public readonly record struct TurnActionInstruction(int PlayerID, int Count, int Bit)
|
|
{
|
|
public static TurnActionInstruction Get(byte Op)
|
|
{
|
|
var PlayerID = Op >> 5;
|
|
var Bit = (Op >> 4) & 1;
|
|
var Count = Op & 0xF;
|
|
return new TurnActionInstruction(PlayerID, Count, Bit);
|
|
}
|
|
|
|
public byte GetRawValue => (byte)((Count & 0xF) | ((byte)Bit << 4) | (PlayerID << 5));
|
|
}
|