UNPKG

goban-engine

Version:

This contains the built Go engine that is used by the Goban package. There are no display components in this package, only the logic for playing the game of Go, making it suitable for usage in node.js or other server-side environments.

69 lines (68 loc) 2.53 kB
import { ClientToServerBase, RuleSet } from "./ClientToServer"; import { JGOFMove, JGOFNumericPlayerColor } from "../formats/JGOF"; /** This is an exhaustive list of the messages that the client can send * to the AI servers. */ export interface ClientToAIServer extends ClientToServerBase { "ai-review-connect": (data: { /** AI UUID */ uuid: string; /** The game id we're reviewing */ game_id: number | string; /** The AI review id we're basing our analysis off of */ ai_review_id: number | string; }) => void; "ai-review-disconnect": (data: { /** AI UUID */ uuid: string; }) => void; "ai-analyze-variation": (data: { /** AI UUID */ uuid: string; /** The game id we're analyzing */ game_id: number | string; /** The AI review id we're basing our analysis off of */ ai_review_id: number | string; /** The move number we're branching from */ from: number; /** Move string */ variation: string; }) => void; /** Requests a position be analyzed, intermediate and final results are * sent to the given channel. The final response is returned as well. */ "ai-analyze-position": (data: { /** UUID identifying the request */ uuid: string; /** Channel identifier, for instance ai-position-analysis-stream-review-<id> */ channel_id: string; /** Ruleset to use */ rules: RuleSet; /** Board position state */ board: number[][]; /** Number of captures black has */ black_prisoners: number; /** Number of captures white has */ white_prisoners: number; /** Komi */ komi: number; /** Whose turn it is */ player: JGOFNumericPlayerColor; /** Moves to replay */ moves?: JGOFMove[]; /** Unique board string used to relay to other clients */ board_string?: string; }) => any; /** Relay an already analyzed position out to any other viewers */ "ai-relay-analyzed-position": (data: { /** Channel identifier, for instance ai-position-analysis-stream-review-<id> */ channel_id: string; data: any; }) => any; /** Subscribers to analyze position calls */ "ai-analyze-subscribe": (data: { channel_id: string; }) => void; /** Un-subscribers to analyze position calls */ "ai-analyze-unsubscribe": (data: { channel_id: string; }) => void; }