ESCScriptBuilder
Extends: RefCounted
Description
Convenience class to help build scripts in code for use with the ASHES compiler toolchain. Loosely follows the Builder pattern.
Members
Methods
build
func build() -> Variant
The script as it currently exists. No building is actually performed and therefore no error checking of any kind is performed.
Parameters
None.
Returns
Returns the script as it currently exists. No building is actually performed and therefore no error checking of any kind is performed. (String)
add_event
func add_event(name: String, flags: Array) -> Variant
Adds an Escoria event to the script.
Parameters
Name |
Type |
Description |
Required? |
|---|---|---|---|
name |
|
Event identifier to add to the script. |
yes |
flags |
|
an array of flags for the event, e.g. |
yes |
Returns
Returns nothing.
begin_block
func begin_block() -> Variant
Begins a new block/scope for the script.
Parameters
None.
Returns
Returns self for method chaining. (ESCScriptBuilder)
end_block
func end_block() -> Variant
Closes the current block/scope of the script.
Parameters
None.
Returns
Returns self for method chaining. (ESCScriptBuilder)
add_command
func add_command(name: String, args: Variant) -> Variant
Adds a command to be called in the script.
Parameters
Name |
Type |
Description |
Required? |
|---|---|---|---|
name |
|
Command name to append to the script. |
yes |
args |
|
the arguments for the command; can be a single argument or an array |
yes |
Returns
Returns nothing.