diff --git a/src/engine/target.js b/src/engine/target.js index 53591cc08..acb2b30a6 100644 --- a/src/engine/target.js +++ b/src/engine/target.js @@ -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; diff --git a/src/sprites/clone.js b/src/sprites/clone.js index ba025ab73..408667ab8 100644 --- a/src/sprites/clone.js +++ b/src/sprites/clone.js @@ -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;