GlobalVariable ​
Inherits: DatabaseResource < Resource
Individual global variable resource Stores a single named variable with type safety and metadata
Properties ​
String | variable_key | "" |
VariableType | variable_type | VariableType.INT |
int | int_value | 0 |
float | float_value | 0.0 |
bool | bool_value | false |
String | string_value | "" |
Array | array_value | [] |
Dictionary | dictionary_value | {} |
Methods ​
Variant | get_value() |
void | set_value( value: Variant ) |
String | get_type_string() |
Enumerations ​
enum VariableType ​
The options of variable type: int, float, bool, string, array, dictionary.
- INT =
0 - FLOAT =
1 - BOOL =
2 - STRING =
3 - ARRAY =
4 - DICTIONARY =
5
Property descriptions ​
String variable_key = "" ​
Variable key (unique identifier)
VariableType variable_type = VariableType.INT ​
Type of the variable
int int_value = 0 ​
The actual value stored (type depends on variable_type)
float float_value = 0.0 ​
The value of a decimal variable.
bool bool_value = false ​
The value of a yes/no variable.
String string_value = "" ​
The value of a text variable.
Array array_value = [] ​
The value of a list variable.
Dictionary dictionary_value = ​
The value of a dictionary variable.
Method descriptions ​
Variant get_value() ​
Get the current value based on type
void set_value( value: Variant ) ​
Set the value (automatically determines type)
String get_type_string() ​
Get type as string