Clipboard export / Conditional jumps / Saving of state

This commit is contained in:
Anuken
2020-08-09 18:26:54 -04:00
parent 4efba475de
commit 73d9348c83
20 changed files with 172 additions and 35 deletions

View File

@@ -0,0 +1,29 @@
package mindustry.logic;
public enum ConditionOp{
equal("==", (a, b) -> Math.abs(a - b) < 0.000001),
notEqual("not", (a, b) -> Math.abs(a - b) >= 0.000001),
lessThan("<", (a, b) -> a < b),
lessThanEq("<=", (a, b) -> a <= b),
greaterThan(">", (a, b) -> a > b),
greaterThanEq(">=", (a, b) -> a >= b);
public static final ConditionOp[] all = values();
public final CondOpLambda function;
public final String symbol;
ConditionOp(String symbol, CondOpLambda function){
this.symbol = symbol;
this.function = function;
}
@Override
public String toString(){
return symbol;
}
interface CondOpLambda{
boolean get(double a, double b);
}
}