mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-18 03:25:17 +00:00
* wip backport of custom uniforms * Functioning custom uniforms maybe? * Workon separating dynamic/non-dynamic uniforms and making variables available to custom uniforms (currently the JVM dies horribly) * wip * It no longer crashes horrifically * star imports
30 lines
707 B
Java
30 lines
707 B
Java
package kroppeb.stareval.function;
|
|
|
|
import kroppeb.stareval.expression.Expression;
|
|
|
|
@FunctionalInterface
|
|
public interface II2IFunction extends TypedFunction {
|
|
int eval(int a, int b);
|
|
|
|
@Override
|
|
default void evaluateTo(Expression[] params, FunctionContext context, FunctionReturn functionReturn) {
|
|
params[0].evaluateTo(context, functionReturn);
|
|
int a = functionReturn.intReturn;
|
|
|
|
params[1].evaluateTo(context, functionReturn);
|
|
int b = functionReturn.intReturn;
|
|
|
|
functionReturn.intReturn = this.eval(a, b);
|
|
}
|
|
|
|
@Override
|
|
default Type getReturnType() {
|
|
return Type.Int;
|
|
}
|
|
|
|
@Override
|
|
default Parameter[] getParameters() {
|
|
return new Parameter[]{Type.IntParameter, Type.IntParameter};
|
|
}
|
|
}
|