mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-26 07:52:50 -05:00
a118d50056
* 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
18 lines
417 B
JavaScript
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;
|