@logic-pad/core
Version:
37 lines (36 loc) • 1.26 kB
JavaScript
import { instance as undercluedInstance } from '../../rules/undercluedRule.js';
import EventIteratingSolver from '../eventIteratingSolver.js';
export default class UniversalSolver extends EventIteratingSolver {
constructor() {
super(...arguments);
Object.defineProperty(this, "id", {
enumerable: true,
configurable: true,
writable: true,
value: 'universal'
});
Object.defineProperty(this, "author", {
enumerable: true,
configurable: true,
writable: true,
value: 'romain22222, Lysine'
});
Object.defineProperty(this, "description", {
enumerable: true,
configurable: true,
writable: true,
value: 'A backtracking solver that supports all rules and symbols (including underclued) but is less optimized.'
});
}
createWorker() {
return new Worker(new URL('./universalWorker.js', import.meta.url), {
type: 'module',
});
}
isInstructionSupported(instructionId) {
if (super.isInstructionSupported(instructionId)) {
return true;
}
return instructionId === undercluedInstance.id;
}
}