mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-18 03:25:17 +00:00
Support for custom uniforms (#902)
* 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
This commit is contained in:
1 parent
6fa973dbc8
commit
bed724ba59
89 files changed
+4622
-266
No files matched your search
@@ -0,0 +1,29 @@
|
||||
package kroppeb.stareval.function;
|
||||
|
||||
import kroppeb.stareval.expression.Expression;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface II2BFunction extends TypedFunction {
|
||||
boolean 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.booleanReturn = this.eval(a, b);
|
||||
}
|
||||
|
||||
@Override
|
||||
default Type getReturnType() {
|
||||
return Type.Boolean;
|
||||
}
|
||||
|
||||
@Override
|
||||
default Parameter[] getParameters() {
|
||||
return new Parameter[]{Type.IntParameter, Type.IntParameter};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user