Drag[en]gine Script Module DragonScript
1.21
|
Stores named parameters in a table. More...
Public Member Functions | |
void | clear () |
Clear parameter table. More... | |
ParameterTableEntry | find (Block ablock) |
Find parameter. More... | |
void | forEach (Block ablock) |
Visit parameters with block with ParameterTableEntry as parameter. More... | |
ParameterTableEntry | getAt (String name) |
Get parameter adding it if absent. More... | |
ParameterTableEntry | getAtOrNull (String name) |
Get parameter or null if absent. More... | |
int | getCount () |
Count of parameters. More... | |
Array | getNames () |
List of all parameter names as Array of String. More... | |
bool | has (String name) |
Parameter is present. More... | |
ParameterTable | new () |
Create parameter table. More... | |
void | remove (String name) |
Remove parameter. More... | |
void | removeAll () |
Remove all parameters. More... | |
void | writeToFile (PersistencyEnvironment env, FileWriter writer) |
Write parameter table to file. More... | |
Public Attributes | |
Dictionary | pParameters |
Parameters. More... | |
Stores named parameters in a table.
Allows to store parameter with primitive or persistable type for game elements or global game state. Parameter tables are sometimes called "Black boards". Various game scripts can set values in a table while other game scripts can read the values from the table without the individual systems knowing each other. For performance reasons the entries in the table are queried and can be stored locally to avoid looking them up all the time. In addition to primitive values parameters support objects implementing the Persistable interface. This allows parameter tables to be stored in save states easily. Parameter values are cleared by setting them to null. This avoids the need to remove parameters from the table.
The parameter table is a pure storage facility. No notifications about changes to parameter values is done in any way. If you need tracking state changes use TSTriggerTable or the EventTracker.
void Dragengine.ParameterTable.clear | ( | ) |
Clear parameter table.
ParameterTableEntry Dragengine.ParameterTable.find | ( | Block | ablock | ) |
Find parameter.
Block receives argument ParameterTableEntry and returns bool if matching entry is found.
void Dragengine.ParameterTable.forEach | ( | Block | ablock | ) |
Visit parameters with block with ParameterTableEntry as parameter.
ParameterTableEntry Dragengine.ParameterTable.getAt | ( | String | name | ) |
Get parameter adding it if absent.
ParameterTableEntry Dragengine.ParameterTable.getAtOrNull | ( | String | name | ) |
Get parameter or null if absent.
int Dragengine.ParameterTable.getCount | ( | ) |
Count of parameters.
Array Dragengine.ParameterTable.getNames | ( | ) |
List of all parameter names as Array of String.
bool Dragengine.ParameterTable.has | ( | String | name | ) |
Parameter is present.
ParameterTable Dragengine.ParameterTable.new | ( | ) |
Create parameter table.
void Dragengine.ParameterTable.remove | ( | String | name | ) |
Remove parameter.
void Dragengine.ParameterTable.removeAll | ( | ) |
Remove all parameters.
void Dragengine.ParameterTable.writeToFile | ( | PersistencyEnvironment | env, |
FileWriter | writer | ||
) |
Write parameter table to file.
Dictionary Dragengine.ParameterTable.pParameters |
Parameters.