Add naming mechanism for targets/clones
This commit is contained in:
1 parent
2c6722b958
commit
ad82a5cb74
2 files changed
+19
No files matched your search
@@ -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;
|
||||
Reference in new issue
Block a user