UNPKG

@rbxts/tic-tac-toe

Version:

Modular tic-tac-toe without dependencies, because why not.

30 lines (29 loc) 923 B
/// <reference types="@rbxts/compiler-types" /> import { TicTacToeSymbol } from "../enum/TicTacToeSymbol"; import { TicTacToeBoard } from "../TicTacToeBoard"; /** * The base class for a TicTacToe player. */ export declare abstract class TicTacToePlayer { private name; /** * Constructs a new TicTacToePlayer. * * @param name The name of the player. */ constructor(name: string); /** * Asks the player to make a move based on the given board. * * @param board The board to make a move on. * @returns The move the player made, or undefined if the game should be cancelled. */ abstract makeMove(board: TicTacToeBoard, ownSymbol: Exclude<TicTacToeSymbol, TicTacToeSymbol.EMPTY>): { row: number; col: number; } | undefined | void; /** * Returns the name of this player. */ getName(): string; }