Variables - e-ucm/ead GitHub Wiki

Maintain game-state.

VariableDef

Example: an integer "gold" variable:

{
    name: "points",
    type: "integer",
    initialValue: "0"
}

Example: a boolean "hasCreditCard" variable (also called a flag):

{
    name: "hasCreditCard",
    type: "boolean",
    initialValue: "false"
}

Example: a string "name" variable:

{
    name: "name",
    type: "string",
    initialValue: "Player"
}

VarsContext

A collection of variables is called a VarsContext. These contexts are created whenever a game (or subgame) is loaded.

A given VarsContext also contains an API to query, add, and update its variables.