mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-24 09:06:39 +00:00
refactor Function and FunctionBuilder
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package com.dfsek.terra.addons.terrascript.api;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface Function<T> extends Returnable<T> {
|
||||
Function<?> NULL = new Function<Object>() {
|
||||
@Override
|
||||
public ReturnType returnType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object apply(ImplementationArguments implementationArguments, Map<String, Variable<?>> variableMap) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Position getPosition() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.dfsek.terra.addons.terrascript.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FunctionBuilder<T extends Function<?>> {
|
||||
T build(List<Returnable<?>> argumentList, Position position) throws ParseException;
|
||||
|
||||
int argNumber();
|
||||
|
||||
Returnable.ReturnType getArgument(int position);
|
||||
}
|
||||
Reference in New Issue
Block a user