Scope
Package: com.hypixel.hytale.server.npc.util.expression
public interface ScopeContract for providing named variables and functions to the expression compiler and executor. A scope supplies typed supplier accessors for all six value types (string, number, boolean, and their array variants), a function lookup, a constness check, and a type query. Default methods delegate supplier calls for convenience (e.g. getString calls getStringSupplier(...).get()).
Abstract Methods
Section titled “Abstract Methods”| Return Type | Signature |
|---|---|
Supplier<String> | getStringSupplier(String name) |
DoubleSupplier | getNumberSupplier(String name) |
BooleanSupplier | getBooleanSupplier(String name) |
Supplier<String[]> | getStringArraySupplier(String name) |
Supplier<double[]> | getNumberArraySupplier(String name) |
Supplier<boolean[]> | getBooleanArraySupplier(String name) |
Function | getFunction(String name) |
boolean | isConstant(String name) |
@Nullable ValueType | getType(String name) |
Default Methods
Section titled “Default Methods”| Return Type | Signature |
|---|---|
String | getString(String name) |
double | getNumber(String name) |
boolean | getBoolean(String name) |
String[] | getStringArray(String name) |
double[] | getNumberArray(String name) |
boolean[] | getBooleanArray(String name) |
Static Methods
Section titled “Static Methods”| Modifier | Return Type | Signature |
|---|---|---|
@Nonnull static | String | encodeFunctionName(@Nonnull String name, @Nonnull ValueType[] values) |
static | char | encodeType(@Nonnull ValueType type) |
encodeFunctionName produces a mangled key like max@nn for overload resolution. Each ValueType maps to a single character (n, s, b, N, S, B).
Inner Types
Section titled “Inner Types”Function (functional interface)
Section titled “Function (functional interface)”@FunctionalInterfacepublic interface Function { void call(ExecutionContext context, int numArgs);}A callable expression function. Receives the ExecutionContext (with arguments on the stack) and the argument count.
Related Types
Section titled “Related Types”- StdScope — symbol-table implementation of this interface
- StdLib — singleton standard library scope
- ExecutionContext — the VM that reads from scopes
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.