mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-10 15:02:06 -05:00
Add naming mechanism for targets/clones
This commit is contained in:
parent
2c6722b958
commit
ad82a5cb74
2 changed files with 19 additions and 0 deletions
|
@ -27,4 +27,14 @@ function Target (blocks) {
|
|||
this.blocks = blocks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a human-readable name for this target.
|
||||
* Target implementations should override this.
|
||||
* @abstract
|
||||
* @returns {string} Human-readable name for the target.
|
||||
*/
|
||||
Target.prototype.getName = function () {
|
||||
return this.id;
|
||||
};
|
||||
|
||||
module.exports = Target;
|
||||
|
|
|
@ -226,4 +226,13 @@ Clone.prototype.updateAllDrawableProperties = function () {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the human-readable name for this clone, i.e., the sprite's name.
|
||||
* @override
|
||||
* @returns {string} Human-readable name for the clone.
|
||||
*/
|
||||
Clone.prototype.getName = function () {
|
||||
return this.sprite.name;
|
||||
};
|
||||
|
||||
module.exports = Clone;
|
||||
|
|
Loading…
Reference in a new issue