MagicFunctions

Core Language View source
MagicFunctions

builtin magic function. Calls all functions with the given annotation, for example callFunctionsWithAnnotation("@initializeObject"). The called functions must not take any parameters.

Source on GitHub

Functions

compileError

public function compileError(string msg)

Stops compilation with the provided error message

getMapName

public function getMapName() returns string

Returns the map name from wurst.build file

getBuildDate

public function getBuildDate() returns string

Returns the build date in uuuu-MM-dd’T’HH:mm format

isProductionBuild

public function isProductionBuild() returns boolean

Returns true if the map is being built using the ‘buildmap’ command, false otherwise.

getStackTraceString

public function getStackTraceString() returns string

builtin function which returns a stack trace. If stack traces are disabled, this function returns the empty string.

callFunctionsWithAnnotation

public function callFunctionsWithAnnotation(string _annotation)

compiletime

public function compiletime<T:>(T expr) returns T

This is a builtin magic function.

  • It evaluates it’s argument at compiletime and replaces the call with the result.

Constants

compiletime

public constant compiletime = false

this is a magic constant. It is always false at runtime and true during compiletime.

isLua

public constant isLua = false

This 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.