2022-02-22 00:11:58 +00:00
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
|
|
|
|
|
|
public readonly record struct TurnStartInstruction(TurnStartCode TurnCode, int Count)
|
2018-08-19 03:10:30 +00:00
|
|
|
|
{
|
2022-02-22 00:11:58 +00:00
|
|
|
|
public static TurnStartInstruction Get(byte Op)
|
2018-08-19 03:10:30 +00:00
|
|
|
|
{
|
2022-02-22 00:11:58 +00:00
|
|
|
|
var TurnCode = (TurnStartCode)(Op >> 4);
|
|
|
|
|
var Count = Op & 0xF;
|
|
|
|
|
return new TurnStartInstruction(TurnCode, Count);
|
2018-08-19 03:10:30 +00:00
|
|
|
|
}
|
2022-02-22 00:11:58 +00:00
|
|
|
|
|
|
|
|
|
public byte GetRawValue => (byte) ((Count & 0xF) | ((byte) TurnCode << 4));
|
|
|
|
|
}
|