@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
38 lines (30 loc) • 913 B
JavaScript
import { assert } from "../../../../core/assert.js";
/**
* @template T
*/
export class GMLReferenceCompiler {
/**
*
* @param options
* @param {StaticKnowledgeDatabase} database
* @param {Localization} localization
* @param {GMLEngine} gml
* @param {DomTooltipManager} tooltips
* @returns {T}
*/
compile(options, database, localization, gml, tooltips) {
// override when implementing
throw new Error('Not Implemented');
}
/**
* @template T
* @param {function(options, database:StaticKnowledgeDatabase, localization:Localization, gml:GMLEngine, tooltips:DomTooltipManager):T} f
* @returns {GMLReferenceCompiler<T>}
*/
static fromFunction(f) {
assert.isFunction(f, 'f');
const r = new GMLReferenceCompiler();
r.compile = f;
return r;
}
}