Class StoneString

A StoneString instance represents a group of intersections that are connected to each other and are all the same color.

Constructors

Properties

__added_neighbors: {
    [group_id: number]: boolean;
}

Type declaration

  • [group_id: number]: boolean
id: number
intersections: JGOFIntersection[]
is_territory: boolean = false
neighboring_space: StoneString[]
neighboring_stone_strings: StoneString[]
neighbors: StoneString[]
territory_color: JGOFNumericPlayerColor = 0

Methods

  • Adds a stone string to our neighbor list. This should probably only be called by StoneStringBuilder.

    Parameters

    Returns void

  • Add a stone to the group. This should probably only be called by StoneStringBuilder.

    Parameters

    • x: number
    • y: number

    Returns void

  • Compute if this string is considered potential territory (if all of it's neighbors are the same color). NOTE: This does not perform any advanced logic to determine seki status or anything like that, this only looks to see if the string contains EMPTY locations and that all of the surrounding neighboring are the same color. This should probably only be called by StoneStringBuilder.

    Returns void

  • Parameters

    • fn: ((stone_string) => void)
        • (stone_string): void
        • Parameters

          Returns void

    Returns void

  • Parameters

    • fn: ((stone_string) => void)
        • (stone_string): void
        • Parameters

          Returns void

    Returns void

  • Parameters

    • fn: ((stone_string) => void)
        • (stone_string): void
        • Parameters

          Returns void

    Returns void