Drag[en]gine Script Module DragonScript  1.21
Dragengine.ParameterTable Class Reference

Stores named parameters in a table. More...

Inheritance diagram for Dragengine.ParameterTable:

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...
 

Detailed Description

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.

Member Function Documentation

◆ clear()

void Dragengine.ParameterTable.clear ( )

Clear parameter table.

◆ find()

ParameterTableEntry Dragengine.ParameterTable.find ( Block  ablock)

Find parameter.

Version
1.21

Block receives argument ParameterTableEntry and returns bool if matching entry is found.

◆ forEach()

void Dragengine.ParameterTable.forEach ( Block  ablock)

Visit parameters with block with ParameterTableEntry as parameter.

◆ getAt()

ParameterTableEntry Dragengine.ParameterTable.getAt ( String  name)

Get parameter adding it if absent.

◆ getAtOrNull()

ParameterTableEntry Dragengine.ParameterTable.getAtOrNull ( String  name)

Get parameter or null if absent.

◆ getCount()

int Dragengine.ParameterTable.getCount ( )

Count of parameters.

Version
1.21

◆ getNames()

Array Dragengine.ParameterTable.getNames ( )

List of all parameter names as Array of String.

Version
1.21

◆ has()

bool Dragengine.ParameterTable.has ( String  name)

Parameter is present.

◆ new()

ParameterTable Dragengine.ParameterTable.new ( )

Create parameter table.

◆ remove()

void Dragengine.ParameterTable.remove ( String  name)

Remove parameter.

◆ removeAll()

void Dragengine.ParameterTable.removeAll ( )

Remove all parameters.

◆ writeToFile()

void Dragengine.ParameterTable.writeToFile ( PersistencyEnvironment  env,
FileWriter  writer 
)

Write parameter table to file.

Member Data Documentation

◆ pParameters

Dictionary Dragengine.ParameterTable.pParameters

Parameters.


The documentation for this class was generated from the following file: