I have a few methods that have similar structure to each other. The only difference is the variable that is begin tested and which boolean condition is required.
public void OP_BCS(sbyte b)
{
cv.PC += 2;
if (cv._C == true)
{
cv.PC += (ushort)b;
}
}
Is it possible to change the above code to something similar to what I have below (syntax might be incorrect, but should work in explaining what I mean)
public void OP_Branch(variable name, boolean condition, sbyte b)
{
cv.PC += 2;
if (variable == condition)
{
cv.PC += (ushort)b;
}
}
I'd be able to make all the different combinations I need simply by giving the method a few extra parameters.