Fixed #4642 / Logic op reorganization

This commit is contained in:
Anuken
2021-02-09 09:34:58 -05:00
parent 38843c25fb
commit a99151441c
6 changed files with 48 additions and 19 deletions

View File

@ -28,11 +28,11 @@ public enum LogicOp{
xor("xor", (a, b) -> (long)a ^ (long)b),
not("flip", a -> ~(long)(a)),
max("max", Math::max),
min("min", Math::min),
atan2("atan2", (x, y) -> Mathf.atan2((float)x, (float)y) * Mathf.radDeg),
dst("dst", (x, y) -> Mathf.dst((float)x, (float)y)),
noise("noise", LExecutor.noise::rawNoise2D),
max("max", true, Math::max),
min("min", true, Math::min),
angle("angle", true, (x, y) -> Angles.angle((float)x, (float)y)),
len("len", true, (x, y) -> Mathf.dst((float)x, (float)y)),
noise("noise", true, LExecutor.noise::rawNoise2D),
abs("abs", a -> Math.abs(a)),
log("log", Math::log),
log10("log10", Math::log10),
@ -49,19 +49,29 @@ public enum LogicOp{
public final OpObjLambda2 objFunction2;
public final OpLambda2 function2;
public final OpLambda1 function1;
public final boolean unary;
public final boolean unary, func;
public final String symbol;
LogicOp(String symbol, OpLambda2 function){
this(symbol, function, null);
}
LogicOp(String symbol, boolean func, OpLambda2 function){
this.symbol = symbol;
this.function2 = function;
this.function1 = null;
this.unary = false;
this.objFunction2 = null;
this.func = func;
}
LogicOp(String symbol, OpLambda2 function, OpObjLambda2 objFunction){
this.symbol = symbol;
this.function2 = function;
this.function1 = null;
this.unary = false;
this.objFunction2 = objFunction;
this.func = false;
}
LogicOp(String symbol, OpLambda1 function){
@ -70,6 +80,7 @@ public enum LogicOp{
this.function2 = null;
this.unary = true;
this.objFunction2 = null;
this.func = false;
}
@Override