main module¶
-
main.
play
(white: Clients.ClientInterface.ClientInterface, black: Clients.ClientInterface.ClientInterface)[source]¶ Starts a game between two clients reuses a client if possible to start a new game
-
class
Clients.ClientInterface.
ClientInterface
(color: bool)[source]¶ Defines interface of a client
-
abstract
get_move
() → chess.engine.PlayResult[source]¶ Returns next move from client
- Returns
next move played by the client in the normal engine output format
-
abstract
set_move
(move: chess.engine.PlayResult) → None[source]¶ Report new move to client
- Parameters
move – reports move of opponent to client using normal engine output format
-
game_is_over
() → bool[source]¶ Checks if game is over
Implementations of PlayerClientInterface can choose to extend this method to display the result, accept resignation or accept draw offers
- Returns
Returns True iff game is over
-
synchronize_clocks
(clock: Optional[Tuple[datetime.timedelta, datetime.timedelta]] = None) → Optional[Tuple[datetime.timedelta, datetime.timedelta]][source]¶ Synchronize clocks between two clients
- Parameters
clock – Input clock from the other client (white time, black time)
- Returns
return clock from current client (white time, black time) if available
-
abstract