Class: Command

Command(typeName, target, value, duration)

Command with type, target, value and duration. Command such as a set command with a specified type, target, value and duration.

Constructor

new Command(typeName, target, value, duration)

Create a new Command.
Parameters:
Name Type Description
typeName string Type of the command.
target string Target of the command (e.g., "domestic", "import", "export", "equipment", "priorEquipment", "bank", "priorBank", "sales"). Note: "bank" and "priorBank" are synonyms for "equipment" and "priorEquipment" respectively.
value EngineNumber Value for the command.
duration YearMatcher Duration for the command.
Source:

Methods

getDuration() → {YearMatcher}

Get the duration for which this command applies.
Source:
Returns:
The duration specification, or null for all years.
Type
YearMatcher

getIsCompatible() → {boolean}

Check if this command is compatible with UI editing.
Source:
Returns:
Always returns true as basic commands are UI-compatible.
Type
boolean

getTarget() → {string}

Get the target of this command.
Source:
Returns:
The target name (e.g., "domestic", "import", "equipment", "bank", etc). Note: "bank" and "priorBank" are accepted as synonyms for "equipment" and "priorEquipment".
Type
string

getTypeName() → {string}

Get the type name of this command.
Source:
Returns:
The command type name (e.g. "change", "retire", "setVal", etc).
Type
string

getValue() → {EngineNumber}

Get the value associated with this command.
Source:
Returns:
The command's value with units.
Type
EngineNumber