PKHeX/PKHeX.Core/Saves/Substructures/Battle Videos/TurnActionCode.cs

26 lines
593 B
C#
Raw Normal View History

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,
}
public readonly record struct TurnActionInstruction(int PlayerID, int Count, int Bit)
2018-08-19 03:10:30 +00:00
{
public TurnActionInstruction(byte Op) : this()
2018-08-19 03:10:30 +00:00
{
PlayerID = Op >> 5;
Bit = (Op >> 4) & 1;
2018-08-19 03:10:30 +00:00
Count = Op & 0xF;
}
public byte GetRawValue => (byte)((Count & 0xF) | ((byte)Bit << 4) | (PlayerID << 5));
2018-08-19 03:10:30 +00:00
}
}