ESCCommand
Extends: RefCounted
Description
Used to properly setup and execute commands, i.e. those that extend ESCBaseCommand.
Despite its name, ESCCommand is more of a container and orchestrator than an actual command.
Members
name
var name: String
The name of this command.
parameters
var parameters: Array
Parameters for this command
channel_name
var channel_name: String
Channel where this command’s owning event is running.
parser_token
var parser_token: ESCToken
The token generated by the parser containing info for debugging (e.g. line number, script filename, etc.).
Methods
exported
func exported() -> Dictionary
A Dictionary containing the data needed when saving a game.
Parameters
None.
Returns
Returns a Dictionary containing the data needed when saving a game. (Dictionary)
is_valid
func is_valid() -> bool
true iff the command is able to be run.
Parameters
None.
Returns
Returns true iff the command is able to be run. (bool)
run
func run() -> int
Runs the command contained by this ESCCommand.
Parameters
Name |
Type |
Description |
Required? |
|---|---|---|---|
command_params |
|
an array containing the arguments |
yes |
Returns
Returns a int value. (int)
interrupt
func interrupt() -> void
This function interrupts the command. If it was not started, it will not run. If it had already started, the execution will be considered as finished immediately and finish. If it had already finished, nothing will happen.
Parameters
None.
Returns
Returns nothing.