PKHeX/PKHeX.Core/Saves/Substructures/Battle Videos/TurnStartInstruction.cs
Kurt 88ddc5822e c#10: readonly record structs
Reduces some boilerplate constructors/equality compares
2021-12-04 18:32:35 -08:00

13 lines
No EOL
367 B
C#

namespace PKHeX.Core
{
public readonly record struct TurnStartInstruction(TurnStartCode TurnCode, int Count)
{
public TurnStartInstruction(byte Op) : this()
{
TurnCode = (TurnStartCode)(Op >> 4);
Count = Op & 0xF;
}
public byte GetRawValue => (byte) ((Count & 0xF) | ((byte) TurnCode << 4));
}
}