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

14 lines
398 B
C#
Raw Normal View History

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