ESCCondition
Extends: Reference
Description
A condition to run a command
Constants Descriptions
COMPARISON_ACTIVITY
const COMPARISON_ACTIVITY: int = 4
COMPARISON_DESCRIPTION
const COMPARISON_DESCRIPTION: Array = ["Checking if %s %s %s true%s","Checking if %s %s %s equals %s","Checking if %s %s %s greater than %s","Checking if %s %s %s less than %s","Checking if %s %s %s active%s"]
COMPARISON_EQ
const COMPARISON_EQ: int = 1
COMPARISON_GT
const COMPARISON_GT: int = 2
COMPARISON_LT
const COMPARISON_LT: int = 3
COMPARISON_NONE
const COMPARISON_NONE: int = 0
REGEX
const REGEX: String = "^(?<is_negated>!)?(?<comparison>eq|gt|lt)? ?(?<is_inventory>i/)?(?<is_activity>a/)?(?<flag>[^ ]+)( (?<comparison_value>.+))?$"
Regex that matches condition lines
Property Descriptions
flag
var flag: String
Name of the flag compared
negated
var negated: bool = false
Whether this condition is negated
inventory
var inventory: bool = false
Whether this condition is regarding an inventory item (“i/…”)
comparison
var comparison: int
An optional comparison type. Use the COMPARISON-Enum
comparison_value
var comparison_value
The value used together with the comparison type
Method Descriptions
_init
func _init(comparison_string: String)
Create a new condition from an ESC condition string
run
func run() -> bool
Run this comparison against the globals