from typing import Final

BLACK: Final[int]
WHITE: Final[int]
TOTAL_INPUT_PLANES: Final[int]

class Board:
    def __init__(self, width: int, height: int) -> None: ...
    @staticmethod
    def standard() -> Board: ...
    def width(self) -> int: ...
    def height(self) -> int: ...
    def get_piece(self, col: int, row: int) -> int | None: ...
    def set_piece(self, col: int, row: int, piece: int | None) -> None: ...
    def clear(self) -> None: ...
    def __str__(self) -> str: ...
    def __repr__(self) -> str: ...

class Game:
    def __init__(self, width: int, height: int) -> None: ...
    @staticmethod
    def with_options(
        width: int,
        height: int,
        komi: float,
        min_moves_before_pass_possible: int,
        max_moves: int,
        superko: bool,
    ) -> Game: ...
    @staticmethod
    def standard() -> Game: ...
    def komi(self) -> float: ...
    def min_moves_before_pass_possible(self) -> int: ...
    def max_moves(self) -> int: ...
    def move_count(self) -> int: ...
    def score(self) -> tuple[float, float]: ...
    def width(self) -> int: ...
    def height(self) -> int: ...
    def get_piece(self, col: int, row: int) -> int | None: ...
    def set_piece(self, col: int, row: int, piece: int | None) -> None: ...
    def turn(self) -> int: ...
    def is_over(self) -> bool: ...
    def legal_action_indices(self) -> list[int]: ...
    def apply_action(self, action: int) -> bool: ...
    def encode_game_planes(self) -> tuple[list[float], int, int, int]: ...
    def decode_action(self, action: int) -> Move | None: ...
    def total_actions(self) -> int: ...
    def board_shape(self) -> tuple[int, int]: ...
    def input_plane_count(self) -> int: ...
    def reward_absolute(self) -> float: ...
    def reward_from_perspective(self, perspective: int) -> float: ...
    def outcome(self) -> GameOutcome | None: ...
    def legal_moves(self) -> list[Move]: ...
    def is_legal_move(self, move_: Move) -> bool: ...
    def make_move(self, move_: Move) -> bool: ...
    def unmake_move(self) -> bool: ...
    def board(self) -> Board: ...
    def superko(self) -> bool: ...
    def ko_point(self) -> tuple[int, int] | None: ...
    def clone(self) -> Game: ...
    def __hash__(self) -> int: ...
    def __str__(self) -> str: ...
    def __repr__(self) -> str: ...

class Move:
    @staticmethod
    def place(col: int, row: int) -> Move: ...
    @staticmethod
    def pass_move() -> Move: ...
    def is_pass(self) -> bool: ...
    def col(self) -> int | None: ...
    def row(self) -> int | None: ...
    def encode(self, board_width: int, board_height: int) -> int: ...
    @staticmethod
    def decode(action: int, board_width: int, board_height: int) -> Move: ...
    def __str__(self) -> str: ...
    def __repr__(self) -> str: ...
    def __eq__(self, other: Move) -> bool: ...
    def __hash__(self) -> int: ...

class GameOutcome:
    def winner(self) -> int | None: ...
    def encode_winner_absolute(self) -> float: ...
    def encode_winner_from_perspective(self, perspective: int) -> float: ...
    def is_draw(self) -> bool: ...
    def __str__(self) -> str: ...
    def __repr__(self) -> str: ...
    def __eq__(self, other: GameOutcome) -> bool: ...

class GtpEngine:
    def __init__(
        self,
        program: str,
        args: list[str] = ...,
        size: int = 19,
        komi: float = 7.5,
    ) -> None: ...
    def play(self, m: Move) -> None: ...
    def play_as(self, player: int, m: Move) -> None: ...
    def genmove(self) -> Move | None: ...
    def genmove_as(self, player: int) -> Move | None: ...
    def undo(self) -> None: ...
    def clear_board(self) -> None: ...
    def set_komi(self, komi: float) -> None: ...
    def turn(self) -> int: ...
    def is_over(self) -> bool: ...
    def legal_moves(self) -> list[Move]: ...
    def score(self) -> tuple[float, float]: ...
    def size(self) -> int: ...
    def engine_name(self) -> str | None: ...
    def engine_version(self) -> str | None: ...
    def send_command(self, cmd: str, args: list[str]) -> str: ...
    def quit(self) -> None: ...
