builtin magic function. Calls all functions with the given annotation, for example callFunctionsWithAnnotation("@initializeObject"). The called functions must not take any parameters.
public function compileError(string msg)Stops compilation with the provided error message
public function getMapName() returns stringReturns the map name from wurst.build file
public function getBuildDate() returns stringReturns the build date in uuuu-MM-dd’T’HH:mm format
public function isProductionBuild() returns booleanReturns true if the map is being built using the ‘buildmap’ command, false otherwise.
public function getStackTraceString() returns stringbuiltin function which returns a stack trace. If stack traces are disabled, this function returns the empty string.
public function callFunctionsWithAnnotation(string _annotation)public function preserveName()Prevents -opt name minification for a top-level function whose name is used externally.
public constant compiletime = falsethis is a magic constant. It is always false at runtime and true during compiletime.
public constant isLua = falseThis is a magic constant. It is always false when compiling to Jass and true when compiling to Lua. Use it to write backend-specific code paths.
public function compiletime<T:>(T expr) returns TThis is a builtin magic function.
public function wurstForFields(WurstFieldCallback _callback)Emits the callback once for every accessible non-static field of the enclosing class.
The callback receives the source field name and its concrete value. This is compile-time code generation: the generated Jass or Lua contains direct field accesses and no runtime reflection. Use the explicit-target form wurstForFields(target, callback) for classes and tuples.
public function wurstForFields<T:>(T _target, WurstFieldCallback _callback)Emits the callback once for every accessible non-static field of target.
This overload supports class instances and tuple values. The target expression is evaluated once, and the compiler specializes the callback value to each field’s concrete type.
public function wurstMapFields(WurstFieldMapper _callback)Maps every accessible mutable non-static field of the enclosing class.
Each callback result is assigned back to its field. Use the explicit-target form wurstMapFields(target, callback) for classes and tuple variables.
public function wurstMapFields<T:>(T _target, WurstFieldMapper _callback)Maps every accessible mutable non-static field of target.
This overload supports class instances and tuple variables. The target expression is evaluated once, and each specialized callback result is assigned directly back to its field.
public function wurstNewInstance<T:>() returns TConstructs the concrete class T through its accessible zero-argument constructor.
This is an intrinsic rather than runtime reflection. Consequently T must be known concretely at the call site and normal constructor visibility and abstract-class checks still apply.