2018-08-19 03:10:30 +00:00
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
|
|
|
|
public enum TurnActionCode
|
|
|
|
|
{
|
|
|
|
|
None = 0,
|
|
|
|
|
Fight = 1,
|
|
|
|
|
Switch = 3,
|
|
|
|
|
Run = 4,
|
|
|
|
|
UNK5 = 5,
|
|
|
|
|
Rotate = 6,
|
|
|
|
|
UNK7 = 7,
|
|
|
|
|
MegaEvolve = 8,
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-05 02:32:35 +00:00
|
|
|
|
public readonly record struct TurnActionInstruction(int PlayerID, int Count, int Bit)
|
2018-08-19 03:10:30 +00:00
|
|
|
|
{
|
2021-12-05 02:32:35 +00:00
|
|
|
|
public TurnActionInstruction(byte Op) : this()
|
2018-08-19 03:10:30 +00:00
|
|
|
|
{
|
|
|
|
|
PlayerID = Op >> 5;
|
2019-10-26 19:33:58 +00:00
|
|
|
|
Bit = (Op >> 4) & 1;
|
2018-08-19 03:10:30 +00:00
|
|
|
|
Count = Op & 0xF;
|
|
|
|
|
}
|
2019-10-26 19:33:58 +00:00
|
|
|
|
|
|
|
|
|
public byte GetRawValue => (byte)((Count & 0xF) | ((byte)Bit << 4) | (PlayerID << 5));
|
2018-08-19 03:10:30 +00:00
|
|
|
|
}
|
|
|
|
|
}
|