Move RenderedTarget.runtime into Target

Some code in `Target` was already assuming a `runtime` property was
available, so this change just makes it official.
This commit is contained in:
Christopher Willis-Ford 2017-06-16 13:16:13 -07:00
parent b9aefa780f
commit 04871e24d6
2 changed files with 21 additions and 11 deletions

View file

@ -11,17 +11,25 @@ const uid = require('../util/uid');
* Examples include sprites/clones or potentially physical-world devices.
*/
/**
* @param {?Blocks} blocks Blocks instance for the blocks owned by this target.
* @constructor
*/
class Target extends EventEmitter {
constructor (blocks) {
/**
* @param {Runtime} runtime Reference to the runtime.
* @param {?Blocks} blocks Blocks instance for the blocks owned by this target.
* @constructor
*/
constructor (runtime, blocks) {
super();
if (!blocks) {
blocks = new Blocks();
}
/**
* Reference to the runtime.
* @type {Runtime}
*/
this.runtime = runtime;
/**
* A unique ID for this target.
* @type {string}