ESCCommand

Extends: ESCStatement < Object

Description

An ESC command

Constants Descriptions

REGEX

const REGEX: String = "^(\\s*)(?<name>[^\\s]+)(\\s(?<parameters>([^\\[]|$)+))?(\\[(?<conditions>[^\\]]+)\\])?"

Regex matching command lines

Property Descriptions

name

var name: String

The name of this command

parameters

var parameters: Array

Parameters of this command

conditions

var conditions: Array

A list of ESCConditions to run this command. Conditions are combined using logical AND

Method Descriptions

_init

func _init(command_string)

Create a command from a command string

is_valid

func is_valid() -> bool

Check, if conditions match

command_exists

func command_exists() -> bool

Checks that the command exists

Returns True if the command exists, else false.

run

func run() -> var

Run this command

interrupt

func interrupt()

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 was already finished, nothing will happen.