20 lines
401 B
Plaintext
20 lines
401 B
Plaintext
|
///blockFromTemplate(template)
|
||
|
/**
|
||
|
* blockFromTemplate :: BlockTemplate -> Instance
|
||
|
*
|
||
|
* Creates a block from the given template.
|
||
|
*
|
||
|
* @param template the block tempalte to use
|
||
|
* @returns the id of the block instance
|
||
|
*/
|
||
|
|
||
|
var template = argument0;
|
||
|
|
||
|
assertInstanceof(template, BlockTemplate);
|
||
|
|
||
|
var block = createBlock(template.inputs, template.outputs);
|
||
|
block.template = template;
|
||
|
|
||
|
return block;
|
||
|
|