import type { ColourRules, GameSettings, HandicapTerms, Stone } from "../types.ts"; /** * The rules a colour plays under: the variant's spec for that colour, with the * handicap laid over it when the handicap belongs to that colour. * * A handicap can only make a colour's game harder. It adds forbidden shapes, * tightens the line rule, lengthens the line, cuts the stones per turn and * removes captures; it never loosens anything the variant already imposes. * * @param settings - The native game settings to interpret. * @param stone - The black or white colour being examined. * @returns The rules a colour plays under: the variant's spec for that colour, with the handicap laid over it when the handicap belongs to that colour. A handicap can only make a colour's game harder. It adds forbidden shapes, tightens the line rule, lengthens the line, cuts the stones per turn and removes captures; it never loosens anything the variant already imposes. * @example * ```ts * import { createGame, rulesFor } from "@johnmorrisdotca/narabe"; * * const state = createGame({variant:"freestyle",size:15}); * console.log(rulesFor(state.settings,"black")); * ``` */ export declare function rulesFor(settings: GameSettings, stone: Stone): ColourRules; /** * Whether any handicap is in force for anyone: harder rules for one colour, or * a head start for one. * * THE ONE PLACE THAT QUESTION IS ANSWERED, and a rating depends on it: a game * this is true of moves nobody's rating (`handicapRefusal`). The head start * joined here and in `HandicapTerms`, and was refused a rating without anybody * having to find the rating code. * * @param settings - The native game settings to interpret. * @returns Whether any handicap is in force for anyone: harder rules for one colour, or a head start for one. THE ONE PLACE THAT QUESTION IS ANSWERED, and a rating depends on it: a game this is true of moves nobody's rating (`handicapRefusal`). The head start joined here and in `HandicapTerms`, and was refused a rating without anybody having to find the rating code. * @example * ```ts * import { createGame, hasHandicap } from "@johnmorrisdotca/narabe"; * * const state = createGame({variant:"freestyle",size:15}); * console.log(hasHandicap(state.settings)); * ``` */ export declare function hasHandicap(settings: HandicapTerms): boolean; /** * WHICH KIND OF UNEVENNESS a game carries, for the pages that name it: harder * rules for one colour, a head start for one, or neither. Where both are set the * harder rules are named, being the one the handicap panel shows first. Null * exactly where `hasHandicap` is false. */ export declare function handicapKind(settings: HandicapTerms): "handicap" | "headStart" | null;