ESM: Ported MS and Entropy operations

This commit is contained in:
n1474335 2018-05-16 11:39:30 +01:00
parent ebcc5bd9c8
commit 84df055888
10 changed files with 705 additions and 189 deletions

View file

@ -212,7 +212,10 @@ class Recipe {
async present(dish) {
if (!this.lastRunOp) return;
const output = await this.lastRunOp.present(await dish.get(this.lastRunOp.outputType));
const output = await this.lastRunOp.present(
await dish.get(this.lastRunOp.outputType),
this.lastRunOp.ingValues
);
dish.set(output, this.lastRunOp.presentType);
}
@ -270,6 +273,18 @@ class Recipe {
return highlights;
}
/**
* Determines whether the previous operation has a different presentation type to its normal output.
*
* @param {number} progress
* @returns {boolean}
*/
lastOpPresented(progress) {
if (progress < 1) return false;
return this.opList[progress-1].presentType !== this.opList[progress-1].outputType;
}
}
export default Recipe;