Class GobanInteractiveAbstract

This class serves as a functionality layer encapsulating core interactions we do with a Goban, we have it as a separate base class simply to help with code organization and to keep our Goban class size down.

Hierarchy (view full)

Constructors

Properties

__board_redraw_pen_layer_timer __clock_timer? __draw_state __last_pt __update_move_tree _analyze_subtool _analyze_tool _mode _review_controller_id? _review_owner_id? _score_estimator _submit_move? _title analysis_move_counter analysis_removal_last_position analysis_removal_state? bounded_height bounded_width bounds chat_log circle_radius clock_should_be_paused_for_move_submission colored_circles? conditional_path conditional_starting_color conditional_tree config current_cmove? currently_my_cmove dirty_redraw disconnectedFromGame display_width? done_loading_review dont_draw_last_move double_click_submit draw_bottom_labels draw_left_labels draw_right_labels draw_top_labels edit_color? engine errorHandler game_id game_type getPuzzlePlacementSetting? goban_id heatmap? height highlight_movetree_moves interactive isInPushedAnalysis isPlayerController isPlayerOwner label_character label_mark last_clock? last_emitted_captured_stones last_emitted_clock? last_hover_square? last_move? last_move_radius last_paused_by_player_state last_paused_state last_phase? last_review_message last_sound_played_for_a_stone_placement? last_stone_sound leavePushedAnalysis marked_analysis_score? move_selected? no_display onError? on_game_screen one_click_submit original_square_size pause_control? paused_since? pen_marks player_id preloaded_data? previous_mode puzzle_autoplace_delay restrict_moves_to_movetree review_had_gamedata review_id scoring_mode sendLatencyTimer? sent_timed_out_message shift_key_is_down show_variation_move_numbers showing_scores square_size stalling_score_estimate? stone_font_scale stone_placement_enabled stone_removal_auto_scoring_done? variation_stone_opacity width setCallbacks setTranslations

Accessors

Methods

clearAnalysisDrawing clearMark clearMessage clearTransientMark debouncedEmitCapturedStones decodeMoves decodePrettyCoordinates defaultConfig deleteConditionalPath deleteConditionalSegment deleteCustomMark destroy disableDrawing disablePen disableStonePlacement drawPenMarks drawSquare editPlaceByPrettyCoordinates enableDrawing enablePen enableStonePlacement encodeMove encodeMoves followConditionalPath followConditionalSegment getCoordinateDisplaySystem getCurrentConditionalPath getLocation getMarks getShowUndoRequestIndicator getShowVariationMoveNumbers getStoneFontScale getWidthForSquareSize hideScores incrementLabelCharacter isAnalysisDisabled isCurrentUserAPlayer isLastOfficialMove jumpToLastOfficialMove load markDirty move_tree_redraw nextSibling placeByPrettyCoordinates playMovementSound post_config_constructor prettyCoordinates prevSibling redraw scheduleRedrawPenLayer sendMove sendTimedOut set setAnalyzeTool setBounds setColoredCircles setColoredMarks setConditionalTree setCustomMark setEditColor setForRemoval setHeatmap setLabelCharacter setLabelCharacterFromMarks setLastOfficialMove setLetterMark setMark setMarkByPrettyCoordinates setMarkColor setMarks setMode setModeDeferred setMoveTreeContainer setScoringMode setState setSubmit setSubscriptMark setTitle setToPreviousMode setTransientMark showFirst showMessage showNext showPrevious showScores showStallingScoreEstimate toggleMark updateMoveTree updateOrRedrawMoveTree updatePlayerToMoveTitle updateScoreEstimation updateTitleAndStonePlacement xy2ij getCDNReleaseBase getMoveTreeNumbering getSoundEnabled getSoundVolume

Constructors

Properties

__board_redraw_pen_layer_timer: any = null
__clock_timer?: Timeout
__draw_state: string[][]
__last_pt: {
    i: number;
    j: number;
    valid: boolean;
} = ...

Type declaration

  • i: number
  • j: number
  • valid: boolean
__update_move_tree: any = null
_analyze_subtool: string = "alternate"
_analyze_tool: AnalysisTool = "stone"
_mode: GobanModes = "play"
_review_controller_id?: number
_review_owner_id?: number
_score_estimator: null | ScoreEstimator = null
_submit_move?: (() => void)

Type declaration

    • (): void
    • Returns void

_title: string = "play"
analysis_move_counter: number
analysis_removal_last_position: {
    i: number;
    j: number;
} = ...

Type declaration

  • i: number
  • j: number
analysis_removal_state?: boolean
bounded_height: number
bounded_width: number
bounds: GobanBounds
chat_log: GobanChatLog = []
circle_radius: number
clock_should_be_paused_for_move_submission: boolean = false
colored_circles?: (undefined | ColoredCircle)[][]
conditional_path: string = ""
conditional_starting_color: "black" | "white" | "invalid" = "invalid"
conditional_tree: ConditionalMoveTree = ...
config: GobanConfig
current_cmove?: ConditionalMoveTree
currently_my_cmove: boolean = false
dirty_redraw: any = null
disconnectedFromGame: boolean = true
display_width?: number
done_loading_review: boolean = false
dont_draw_last_move: boolean
double_click_submit: boolean
draw_bottom_labels: boolean
draw_left_labels: boolean
draw_right_labels: boolean
draw_top_labels: boolean
edit_color?: "black" | "white"
engine: GobanEngine
errorHandler: ((e) => void)

Type declaration

    • (e): void
    • Parameters

      • e: Error

      Returns void

game_id: number
game_type: string
getPuzzlePlacementSetting?: (() => PuzzlePlacementSetting)
goban_id: number = ++last_goban_id

Base fields *

heatmap?: NumberMatrix
height: number
highlight_movetree_moves: boolean
interactive: boolean
isInPushedAnalysis: (() => boolean)

Type declaration

    • (): boolean
    • Returns boolean

isPlayerController: (() => boolean)

Type declaration

    • (): boolean
    • Returns boolean

isPlayerOwner: (() => boolean)

Type declaration

    • (): boolean
    • Returns boolean

label_character: string
label_mark: string = "[UNSET]"
last_clock?: AdHocClock
last_emitted_captured_stones: JGOFIntersection[] = []
last_emitted_clock?: JGOFClockWithTransmitting
last_hover_square?: JGOFIntersection
last_move?: MoveTree
last_move_radius: number
last_paused_by_player_state: null | boolean = null
last_paused_state: null | boolean = null
last_phase?: GobanEnginePhase
last_review_message: ReviewMessage
last_sound_played_for_a_stone_placement?: string
last_stone_sound: number
leavePushedAnalysis: (() => void)

Type declaration

    • (): void
    • Returns void

marked_analysis_score?: boolean[][]
move_selected?: JGOFIntersection
no_display: boolean
onError?: ((error) => void)

Type declaration

    • (error): void
    • Parameters

      • error: Error

      Returns void

on_game_screen: boolean
one_click_submit: boolean
original_square_size: number | ((goban) => number) | "auto"

Type declaration

    • (goban): number
    • Parameters

      Returns number

pause_control?: AdHocPauseControl
paused_since?: number
pen_marks: any[]
player_id: number
preloaded_data?: GobanConfig
previous_mode: string
puzzle_autoplace_delay: number
restrict_moves_to_movetree: boolean
review_had_gamedata: boolean
review_id: number
scoring_mode: boolean | "stalling-scoring-mode"
sendLatencyTimer?: Timeout
sent_timed_out_message: boolean
shift_key_is_down: boolean
show_variation_move_numbers: boolean
showing_scores: boolean = false
square_size: number = 10
stalling_score_estimate?: StallingScoreEstimate
stone_font_scale: number
stone_placement_enabled: boolean
stone_removal_auto_scoring_done?: boolean = false
variation_stone_opacity: number
width: number
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 destroyed(): boolean
  • Returns boolean

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

    Returns boolean

Methods

  • Parameters

    • x: number
    • y: number
    • mark: string
    • Optional drawSquare: boolean

    Returns void

  • Parameters

    • perGameSettingAppliesToNonPlayers: boolean = false

    Returns boolean

  • Goban calls some abstract methods as part of the construction process. Because our subclasses might (and do) need to do some of their own config before these are called, we set this function to be called by our subclass after it's done it's own internal config stuff.

    Returns GobanEngine

  • Parameters

    • colored_marks: {
          [key: string]: {
              color: string;
              move: string;
          };
      }
      • [key: string]: {
            color: string;
            move: string;
        }
        • color: string
        • move: string

    Returns void

  • Parameters

    • x: number
    • y: number
    • mark: string
    • Optional drawSquare: 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 = true

    Returns void

  • Parameters

    • Optional set_override: "letters" | "numbers"

    Returns void

  • Parameters

    • x: number
    • y: number
    • mark: string
    • Optional drawSquare: boolean

    Returns void

  • Parameters

    • x: number
    • y: number
    • mark: string | number
    • Optional dont_draw: boolean

    Returns void

  • Parameters

    • coordinates: string
    • mark: string | number
    • Optional dont_draw: boolean

    Returns void

  • This is a callback that gets called by GobanEngine.getState to save and board state as it pushes and pops state. Our renderers can override this to save state they need.

    Parameters

    • marks: {
          [mark: string]: string;
      }
      • [mark: string]: string
    • Optional dont_draw: boolean

    Returns void

  • Parameters

    • x: number
    • y: number
    • mark: string
    • drawSquare: boolean = true

    Returns void

  • Parameters

    • Optional dont_jump_to_official_move: boolean

    Returns boolean

  • Parameters

    • x: number
    • y: number
    • mark: string | number
    • Optional dont_draw: boolean

    Returns void

  • Parameters

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

    Returns void

  • Parameters

    • x: number
    • y: number
    • mark: string | number
    • Optional force_label: boolean
    • Optional force_put: boolean

    Returns boolean

  • Parameters

    • x: number
    • y: number
    • anti_slip: boolean = true

    Returns {
        i: number;
        j: number;
        valid: boolean;
    }

    • i: number
    • j: number
    • valid: boolean