Game

class games.checkers.game.Game

Bases: joueur.base_game.BaseGame

The class representing the Game in the Checkers game.

The simple version of American Checkers. An 8x8 board with 12 checkers on each side that must move diagonally to the opposing side until kinged.

property board_height

The height of the board for the Y component of a checker.

Type

int

property board_width

The width of the board for X component of a checker.

Type

int

property checker_moved

The checker that last moved and must be moved because only one checker can move during each players turn.

Type

games.checkers.checker.Checker or None

property checker_moved_jumped

If the last checker that moved jumped, meaning it can move again.

Type

bool

property checkers

All the checkers currently in the game.

Type

list[games.checkers.checker.Checker]

property current_player

The player whose turn it is currently. That player can send commands. Other players cannot.

Type

games.checkers.player.Player

property current_turn

The current turn number, starting at 0 for the first player’s turn.

Type

int

property game_objects

A mapping of every game object’s ID to the actual game object. Primarily used by the server and client to easily refer to the game objects via ID.

Type

dict[str, games.checkers.game_object.GameObject]

get_game_object(id: str) → Optional[joueur.base_game_object.BaseGameObject]

gets the game object with the given id, or None

Returns

BaseGameObject in the game with the given id, or None if not found

property max_turns

The maximum number of turns before the game will automatically end.

Type

int

property players

List of all the players in the game.

Type

list[games.checkers.player.Player]

property session

A unique identifier for the game instance that is being played.

Type

str

property time_added_per_turn

The amount of time (in nano-seconds) added after each player performs a turn.

Type

int