Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.ParameterTable Class Reference

Stores named parameters in a table. More...

Inheritance diagram for Dragengine.ParameterTable:

Public Member Functions

void clear ()
 Clear parameter table.
ParameterTableEntry find (Block ablock)
 Find parameter.
void forEach (Block ablock)
 Visit parameters with block with ParameterTableEntry as parameter.
ParameterTableEntry getAt (String name)
 Get parameter adding it if absent.
ParameterTableEntry getAtOrNull (String name)
 Get parameter or null if absent.
int getCount ()
 Count of parameters.
Array getNames ()
 List of all parameter names as Array of String.
bool has (String name)
 Parameter is present.
ParameterTable new ()
 Create parameter table.
void remove (String name)
 Remove parameter.
void removeAll ()
 Remove all parameters.
void removeIfPresent (String name)
 Remove parameter if present.
void writeToFile (PersistencyEnvironment env, FileWriter writer)
 Write parameter table to file.

Public Attributes

Dictionary pParameters
 Parameters.

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.

References clear(), and pParameters.

Referenced by clear().

◆ find()

ParameterTableEntry Dragengine.ParameterTable.find ( Block ablock)

Find parameter.

Version
1.21

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

Referenced by writeToFile().

◆ forEach()

void Dragengine.ParameterTable.forEach ( Block ablock)

Visit parameters with block with ParameterTableEntry as parameter.

References pParameters.

Referenced by writeToFile().

◆ getAt()

ParameterTableEntry Dragengine.ParameterTable.getAt ( String name)

Get parameter adding it if absent.

References has(), and pParameters.

Referenced by remove().

◆ getAtOrNull()

ParameterTableEntry Dragengine.ParameterTable.getAtOrNull ( String name)

Get parameter or null if absent.

Referenced by removeAll().

◆ getCount()

int Dragengine.ParameterTable.getCount ( )

Count of parameters.

Version
1.21

References removeIfPresent().

Referenced by writeToFile().

◆ getNames()

Array Dragengine.ParameterTable.getNames ( )

List of all parameter names as Array of String.

Version
1.21

References pParameters, and removeAll().

Referenced by writeToFile().

◆ has()

bool Dragengine.ParameterTable.has ( String name)

Parameter is present.

Referenced by getAt().

◆ new()

ParameterTable Dragengine.ParameterTable.new ( )

Create parameter table.

References new(), and pParameters.

Referenced by new().

◆ remove()

void Dragengine.ParameterTable.remove ( String name)

Remove parameter.

References getAt(), and pParameters.

◆ removeAll()

void Dragengine.ParameterTable.removeAll ( )

Remove all parameters.

References getAtOrNull(), and pParameters.

Referenced by getNames().

◆ removeIfPresent()

void Dragengine.ParameterTable.removeIfPresent ( String name)

Remove parameter if present.

Version
1.25

Referenced by getCount().

◆ writeToFile()

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

Write parameter table to file.

References find(), forEach(), getCount(), getNames(), pParameters, and writeToFile().

Referenced by writeToFile().

Member Data Documentation

◆ pParameters

Dictionary Dragengine.ParameterTable.pParameters

Parameters.

Referenced by clear(), forEach(), getAt(), getNames(), new(), remove(), removeAll(), and writeToFile().


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