scratch-vm/src/engine/variable.js
Tim Mickel a118d50056 Variables and lists (#187)
* Import lists and variables from SB2

* Switch to Variable and List objects

* Add Clone.lookupOrCreateVariable, Clone.getVariable, Clone.setVariable

* Add (get, set, change) variable blocks.

* Copy variables and lists on clone instantiation

* Move variable options closer to blocks

* Add list primitives

* Move variable and lists storage to `Target` instead of `Clone`

* Move _computeIndex to a Cast function

* Rename `getList` -> `getListAsString`

* Renames renames

* Remove extra check in Cast.isNaN
2016-09-21 16:38:33 -04:00

18 lines
417 B
JavaScript

/**
* @fileoverview
* Object representing a Scratch variable.
*/
/**
* @param {!string} name Name of the variable.
* @param {(string|Number)} value Value of the variable.
* @param {boolean} isCloud Whether the variable is stored in the cloud.
* @constructor
*/
function Variable (name, value, isCloud) {
this.name = name;
this.value = value;
this.isCloud = isCloud;
}
module.exports = Variable;