2016-06-09 11:45:58 -04:00
|
|
|
function Scratch3EventBlocks(runtime) {
|
|
|
|
/**
|
|
|
|
* The runtime instantiating this block package.
|
|
|
|
* @type {Runtime}
|
|
|
|
*/
|
|
|
|
this.runtime = runtime;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieve the block primitives implemented by this package.
|
|
|
|
* @return {Object.<string, Function>} Mapping of opcode to Function.
|
|
|
|
*/
|
|
|
|
Scratch3EventBlocks.prototype.getPrimitives = function() {
|
|
|
|
return {
|
|
|
|
'event_whenflagclicked': this.whenFlagClicked,
|
|
|
|
'event_whenbroadcastreceived': this.whenBroadcastReceived,
|
|
|
|
'event_broadcast': this.broadcast
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
Scratch3EventBlocks.prototype.whenFlagClicked = function() {
|
|
|
|
// No-op
|
|
|
|
};
|
|
|
|
|
|
|
|
Scratch3EventBlocks.prototype.whenBroadcastReceived = function() {
|
|
|
|
// No-op
|
|
|
|
};
|
|
|
|
|
2016-06-09 14:23:45 -04:00
|
|
|
Scratch3EventBlocks.prototype.broadcast = function() {
|
|
|
|
// @todo
|
2016-06-09 11:45:58 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = Scratch3EventBlocks;
|