2018-08-19 03:10:30 +00:00
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
2019-10-27 06:18:25 +00:00
|
|
|
|
public readonly struct TurnStartInstruction
|
2018-08-19 03:10:30 +00:00
|
|
|
|
{
|
2019-10-27 06:18:25 +00:00
|
|
|
|
public readonly TurnStartCode TurnCode;
|
|
|
|
|
public readonly int Count;
|
2018-08-19 03:10:30 +00:00
|
|
|
|
|
|
|
|
|
public TurnStartInstruction(byte Op)
|
|
|
|
|
{
|
|
|
|
|
TurnCode = (TurnStartCode)(Op >> 4);
|
|
|
|
|
Count = Op & 0xF;
|
|
|
|
|
}
|
2019-10-26 19:33:58 +00:00
|
|
|
|
|
|
|
|
|
public byte GetRawValue => (byte) ((Count & 0xF) | ((byte) TurnCode << 4));
|
|
|
|
|
|
|
|
|
|
public override bool Equals(object obj) => obj is TurnStartInstruction t && t.GetRawValue == GetRawValue;
|
|
|
|
|
public override int GetHashCode() => GetRawValue;
|
|
|
|
|
public static bool operator ==(TurnStartInstruction left, TurnStartInstruction right) => left.Equals(right);
|
|
|
|
|
public static bool operator !=(TurnStartInstruction left, TurnStartInstruction right) => !(left == right);
|
2018-08-19 03:10:30 +00:00
|
|
|
|
}
|
|
|
|
|
}
|