@logic-pad/core
Version:
35 lines (34 loc) • 1.36 kB
TypeScript
import { AnyConfig } from '../config.js';
import { GetTileHandler } from '../events/onGetTile.js';
import GridData from '../grid.js';
import { Position, RuleState, Wrapping } from '../primitives.js';
import Rule, { SearchVariant } from './rule.js';
export default class WrapAroundRule extends Rule implements GetTileHandler {
readonly horizontal: Wrapping;
readonly vertical: Wrapping;
private static readonly EXAMPLE_GRID_NONE;
private static readonly EXAMPLE_GRID_HORIZONTAL;
private static readonly EXAMPLE_GRID_VERTICAL;
private static readonly SEARCH_VARIANTS;
private static readonly CONFIGS;
/**
* **The left and right edges are connected (in reverse)**
*
* @param horizontal - The horizontal wrapping.
* @param vertical - The vertical wrapping.
*/
constructor(horizontal: Wrapping, vertical: Wrapping);
onGetTile(x: number, y: number, grid: GridData): Position;
get id(): string;
get explanation(): string;
createExampleGrid(): GridData;
get configs(): readonly AnyConfig[] | null;
get searchVariants(): SearchVariant[];
validateGrid(grid: GridData): RuleState;
copyWith({ horizontal, vertical, }: {
horizontal?: Wrapping;
vertical?: Wrapping;
}): this;
get isSingleton(): boolean;
}
export declare const instance: WrapAroundRule;