mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-28 23:19:03 -04:00
Add unique ID for Targets
This commit is contained in:
parent
b1a3026ea1
commit
2c6722b958
1 changed files with 10 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
var Blocks = require('./blocks');
|
var Blocks = require('./blocks');
|
||||||
|
var uid = require('../util/uid');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileoverview
|
* @fileoverview
|
||||||
|
@ -14,6 +15,15 @@ function Target (blocks) {
|
||||||
if (!blocks) {
|
if (!blocks) {
|
||||||
blocks = new Blocks(this);
|
blocks = new Blocks(this);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* A unique ID for this target.
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
this.id = uid();
|
||||||
|
/**
|
||||||
|
* Blocks run as code for this target.
|
||||||
|
* @type {!Blocks}
|
||||||
|
*/
|
||||||
this.blocks = blocks;
|
this.blocks = blocks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue