mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-28 22:30:40 -04:00
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:
parent
b9aefa780f
commit
04871e24d6
2 changed files with 21 additions and 11 deletions
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue