mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-04-22 07:18:18 -05:00
Did something similar for NHSE years ago. Allows for much easier reuse elsewhere and clearer usage.
38 lines
734 B
C#
38 lines
734 B
C#
using static PKHeX.Core.InstructionOperation;
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
/// <summary>
|
|
/// Operation type for applying a modification.
|
|
/// </summary>
|
|
public enum InstructionOperation : byte
|
|
{
|
|
Set,
|
|
Add,
|
|
Subtract,
|
|
Multiply,
|
|
Divide,
|
|
Modulo,
|
|
BitwiseAnd,
|
|
BitwiseOr,
|
|
BitwiseXor,
|
|
BitwiseShiftRight,
|
|
BitwiseShiftLeft,
|
|
}
|
|
|
|
public static class InstructionOperationExtensions
|
|
{
|
|
extension(InstructionOperation operation)
|
|
{
|
|
public bool IsBitwise => operation switch
|
|
{
|
|
BitwiseAnd => true,
|
|
BitwiseOr => true,
|
|
BitwiseXor => true,
|
|
BitwiseShiftRight => true,
|
|
BitwiseShiftLeft => true,
|
|
_ => false,
|
|
};
|
|
}
|
|
}
|