UNPKG

@logic-pad/core

Version:
27 lines (26 loc) 1.01 kB
import Configurable from './configurable.js'; import GridData from './grid.js'; import { Mode } from './primitives.js'; export default abstract class Instruction extends Configurable { abstract get id(): string; abstract get explanation(): string; get configExplanation(): string; abstract createExampleGrid(): GridData; /** * Indicates that validation by logic is not available and the solution must be used for validation */ get validateWithSolution(): boolean; get necessaryForCompletion(): boolean; get visibleWhenSolving(): boolean; /** * Return a variant of this instruction that is suitable for the given mode. */ abstract modeVariant(mode: Mode): Instruction | null; /** * Check if this instruction is equal to another instruction by comparing their IDs and configs. * * @param other The other instruction to compare to. * @returns Whether the two instructions are equal. */ equals(other: Instruction): boolean; }