Interface BoardStateWithIsobranchHash

interface BoardStateWithIsobranchHash {
    black_prisoners: number;
    board: JGOFNumericPlayerColor[][];
    board_is_repeating: boolean;
    goban_callback?: GobanBase;
    height: number;
    isobranch_hash?: string;
    player: JGOFNumericPlayerColor;
    removal: boolean[][];
    white_prisoners: number;
    width: number;
    boardEquals(other): boolean;
    clearRemoved(): void;
    cloneBoard(): JGOFNumericPlayerColor[][];
    cloneBoardState(): BoardState;
    computeScoringLocations(area_scoring): ScoringLocations;
    countLiberties(raw_stone_string): number;
    foreachNeighbor(pt_or_raw_stone_string, callback): void;
    getNeighboringRawStoneStrings(raw_stone_string): RawStoneString[];
    getRawStoneString(x, y, clearMarks): RawStoneString;
    setRemoved(x, y, removed, emit_stone_removal_updated?): void;
    toggleSingleGroupRemoval(x, y, force_removal?): {
        group: RawStoneString;
        removed: boolean;
    };
}

Hierarchy (view full)

Properties

black_prisoners: number
board_is_repeating: boolean
goban_callback?: GobanBase
height: number = 19
isobranch_hash?: string

The isobranch hash is a hash of the board state. This field is used by the move tree to detect isomorphic branches. This field is populated when recomputeIsoBranches is called.

removal: boolean[][]
white_prisoners: number
width: number = 19

Methods

  • Sets a position as being removed or not removed. If emit_stone_removal_updated is set to false, the "stone-removal.updated" event will not be emitted, and it is up to the caller to emit this event appropriately.

    Parameters

    • x: number
    • y: number
    • removed: boolean
    • emit_stone_removal_updated: boolean = true

    Returns void

  • Toggles a group of stones for removal or restoration.

    By default, if we are marking a group for removal but the group is almost certainly alive (two eyes, etc), this will result in a no-op, unless force_removal is set to true.

    Parameters

    • x: number
    • y: number
    • force_removal: boolean = false

    Returns {
        group: RawStoneString;
        removed: boolean;
    }