:py:mod:`whist_core.session.table` ================================== .. py:module:: whist_core.session.table .. autoapi-nested-parse:: DAO of session. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: whist_core.session.table.Table .. py:class:: Table(**data: Any) Bases: :py:obj:`whist_core.session.session.Session` The game logics instance of a room to play Whist. .. py:property:: ready :type: bool Flag if the table is ready to start playing. :return Ready or not :rtype: boolean .. py:property:: current_rubber :type: whist_core.game.rubber.Rubber Returns the current rubber :return: the latest rubber entry .. py:attribute:: min_player :type: int .. py:attribute:: max_player :type: int .. py:attribute:: team_size :type: int :value: 2 .. py:attribute:: started :type: bool :value: False .. py:attribute:: rubbers :type: list[whist_core.game.rubber.Rubber] :value: [] .. py:attribute:: matcher :type: whist_core.session.matcher.Matcher .. py:method:: model_dump(*, mode: Union[typing_extensions.Literal[json, python], str] = 'python', include=None, exclude=None, by_alias: bool = False, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool = True) -> dict[str, Any] Overrides model_dump to ensure matcher is correctly dumped. :param mode: :param include: :param exclude: :param by_alias: :param exclude_unset: :param exclude_defaults: :param exclude_none: :param round_trip: :param warnings: :return: .. py:method:: validate_min_is_lower_max_player(values) :classmethod: Checks if the min_player is less or equal than max_player. :param values: :return: .. py:method:: __len__() The amount of players joined. :return: # player :rtype: int .. py:method:: next_rubber() -> whist_core.game.rubber.Rubber Creates the next rubber. In order to create the first rubber use 'Table.start()'. :return: the new rubber .. py:method:: start() -> None Starts the table, but will check if every player is ready first. .. py:method:: join(player: whist_core.user.player.Player) -> None If a seat is available a player joins the table. :param player: who wants to join the table :type player: Player :return: None or raised an error if the table is already full. :rtype: None .. py:method:: leave(player: whist_core.user.player.Player) -> None Remove a player from table. :param player: The player to remove. :type player: Player :return: None :rtype: None .. py:method:: join_team(player: whist_core.user.player.Player, team: int) -> None Player joins a team. :param player: to join a team :type player: Player :param team: id of the new team :type team: int :return: None if successful or raises Error if team is full :rtype: None .. py:method:: player_ready(player) -> None Player says they is ready. :param player: player who is ready :type player: Player :return: None :rtype: None .. py:method:: player_unready(player) -> None Player says they is not ready. :param player: player who is not ready :type player: Player :return: None :rtype: None .. py:method:: _create_rubber()