mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 14:30:56 +00:00
88ddc5822e
Reduces some boilerplate constructors/equality compares
26 lines
No EOL
593 B
C#
26 lines
No EOL
593 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 TurnActionInstruction(byte Op) : this()
|
|
{
|
|
PlayerID = Op >> 5;
|
|
Bit = (Op >> 4) & 1;
|
|
Count = Op & 0xF;
|
|
}
|
|
|
|
public byte GetRawValue => (byte)((Count & 0xF) | ((byte)Bit << 4) | (PlayerID << 5));
|
|
}
|
|
} |