Class GobanBaseAbstract

Goban serves as a base class for our renderers as well as a namespace for various classes, types, and enums.

You can't create an instance of a Goban directly, you have to create an instance of one of the renderers, such as GobanSVG.

Hierarchy (view full)

Constructors

Properties

_destroyed: boolean = false
engine: GobanEngine
goban_id: number = ++last_goban_id

Base fields *

setCallbacks: ((newCallbacks) => void) = setGobanCallbacks

Type declaration

    • (newCallbacks): void
    • Set's callback functions to be called in various situations. You can set any or all of the callbacks, only the provided callbacks will be updated.

      Parameters

      Returns void

setTranslations: ((_catalog, _debug_mode?) => void) = setGobanTranslations

Type declaration

    • (_catalog, _debug_mode?): void
    • Parameters

      Returns void

Accessors

  • get is_game_record(): boolean
  • True if the game is a game record of a real life game

    Returns boolean

Methods

  • Decodes a move string like "A11" into a move object like {x: 0, y: 10}. Also handles the special cases like ".." and "pass" which map to {x: -1, y: -1}.

    Parameters

    • coordinates: string

    Returns JGOFMove

  • Parameters

    • i: number
    • j: number

    Returns void

  • Parameters

    • Optional no_warp: boolean

    Returns void

  • Encodes an x,y pair or a move object like {x: 0, y: 0} into a move string like "A1"

    Parameters

    Returns string

  • Parameters

    • x: number
    • y: number

    Returns string

  • Parameters

    • Optional force_clear: boolean

    Returns void

  • Called when a location is marked or unmarked for removal

    Parameters

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

    Returns void

  • Parameters

    • container: any

    Returns void

  • Called when Engine.setState loads a previously saved board state.

    Returns void

  • Parameters

    • msg_id: MessageID
    • Optional parameters: {
          [key: string]: any;
      }
      • [key: string]: any
    • Optional timeout: number

    Returns void