Drag[en]gine Script Module DragonScript
1.21
|
Nested tree of parameters. More...
Public Member Functions | |
void | forEach (Block ablock) |
Visit parameters with block with arguments path(String) and value(Object). More... | |
Array | getArrayAt (String path, Array default) |
Array value of parameter or default value if absent. More... | |
FloatRectArea | getAt (String path, FloatRectArea default) |
FloatRectArea value of parameter or default value if absent. More... | |
bool | getBoolAt (String path, bool default) |
Boolean value of parameter or default value if absent. More... | |
BorderSize | getBorderSizeAt (String path, BorderSize default) |
BorderSize value of parameter or default value if absent. More... | |
Color | getColorAt (String path, Color default) |
Color value of parameter or default value if absent. More... | |
int | getCount () |
Number of parameters. More... | |
float | getFloatAt (String path, float default) |
Floating point value of parameter or default value if absent. More... | |
int | getIntAt (String path, int default) |
Integer value of parameter or default value if absent. More... | |
Array | getKeys (String path) |
Parameter keys under path as Array of String using '/' separator. More... | |
Array | getKeys (String path, byte separator) |
Parameter keys under path as Array of String. More... | |
Array | getPathList () |
Parameter path list as Array of String. More... | |
Point3 | getPoint3At (String path, Point3 default) |
Point3 value of parameter or default value if absent. More... | |
Point | getPointAt (String path, Point default) |
Point value of parameter or default value if absent. More... | |
RectArea | getRectAreaAt (String path, RectArea default) |
RectArea value of parameter or default value if absent. More... | |
String | getStringAt (String path, String default) |
String value of parameter or default value if absent. More... | |
ParameterTree | getTreeAt (String path, ParameterTree default) |
Tree value of parameter or default value if absent. More... | |
Vector2 | getVector2At (String path, Vector2 default) |
Vector2 value of parameter or default value if absent. More... | |
Vector | getVectorAt (String path, Vector default) |
Vector value of parameter or default value if absent. More... | |
bool | has (String path) |
Parameter is present. More... | |
void | log (Console console, String name) |
Print parameters to console. More... | |
ParameterTree | new () |
Create parameter tree. More... | |
ParameterTree | new (ParameterTree tree) |
Create copy of parameter tree. More... | |
void | remove (String path) |
Remove value if set. More... | |
void | removeAll () |
Remove all values. More... | |
void | setAt (String path, Object value) |
Set value of parameter. More... | |
Nested tree of parameters.
Parameters are retrieved using a path. The value of parameters can be primitive types like string or floating point as well as some basic game engine classes like point or vectors and arrays thereof. Parameter trees can be loaded from and written to XML files. This class is best used to load parameters from XML files without the need to write specific XML loaders and complex parameter storing classes. A typical use case is prototyping, storing small lists of parameters or storing information with structure not known at build time.
This class itself does not enforce a specific path separator. The LoadParameterTree class thought uses '/' as path separator. It is encouraged to use '/' as path separator.
void Dragengine.Utils.ParameterTree.forEach | ( | Block | ablock | ) |
Visit parameters with block with arguments path(String) and value(Object).
Array Dragengine.Utils.ParameterTree.getArrayAt | ( | String | path, |
Array | default | ||
) |
Array value of parameter or default value if absent.
FloatRectArea Dragengine.Utils.ParameterTree.getAt | ( | String | path, |
FloatRectArea | default | ||
) |
FloatRectArea value of parameter or default value if absent.
bool Dragengine.Utils.ParameterTree.getBoolAt | ( | String | path, |
bool | default | ||
) |
Boolean value of parameter or default value if absent.
BorderSize Dragengine.Utils.ParameterTree.getBorderSizeAt | ( | String | path, |
BorderSize | default | ||
) |
BorderSize value of parameter or default value if absent.
Color value of parameter or default value if absent.
int Dragengine.Utils.ParameterTree.getCount | ( | ) |
Number of parameters.
float Dragengine.Utils.ParameterTree.getFloatAt | ( | String | path, |
float | default | ||
) |
Floating point value of parameter or default value if absent.
int Dragengine.Utils.ParameterTree.getIntAt | ( | String | path, |
int | default | ||
) |
Integer value of parameter or default value if absent.
Array Dragengine.Utils.ParameterTree.getKeys | ( | String | path | ) |
Parameter keys under path as Array of String using '/' separator.
Array Dragengine.Utils.ParameterTree.getKeys | ( | String | path, |
byte | separator | ||
) |
Parameter keys under path as Array of String.
Array Dragengine.Utils.ParameterTree.getPathList | ( | ) |
Parameter path list as Array of String.
Point3 value of parameter or default value if absent.
Point value of parameter or default value if absent.
RectArea value of parameter or default value if absent.
String Dragengine.Utils.ParameterTree.getStringAt | ( | String | path, |
String | default | ||
) |
String value of parameter or default value if absent.
ParameterTree Dragengine.Utils.ParameterTree.getTreeAt | ( | String | path, |
ParameterTree | default | ||
) |
Tree value of parameter or default value if absent.
Vector2 value of parameter or default value if absent.
Vector value of parameter or default value if absent.
bool Dragengine.Utils.ParameterTree.has | ( | String | path | ) |
Parameter is present.
void Dragengine.Utils.ParameterTree.log | ( | Console | console, |
String | name | ||
) |
Print parameters to console.
ParameterTree Dragengine.Utils.ParameterTree.new | ( | ) |
Create parameter tree.
ParameterTree Dragengine.Utils.ParameterTree.new | ( | ParameterTree | tree | ) |
Create copy of parameter tree.
Arrays are duplicated but no value inside since all values stored in the parameter tree are considered immutable.
void Dragengine.Utils.ParameterTree.remove | ( | String | path | ) |
Remove value if set.
void Dragengine.Utils.ParameterTree.removeAll | ( | ) |
Remove all values.
void Dragengine.Utils.ParameterTree.setAt | ( | String | path, |
Object | value | ||
) |
Set value of parameter.