whist_core.session.table ======================== .. py:module:: whist_core.session.table .. autoapi-nested-parse:: DAO of session. Classes ------- .. autoapisummary:: whist_core.session.table.Table Module Contents --------------- .. py:class:: Table(**data) Bases: :py:obj:`whist_core.session.session.Session` The game logics instance of a room to play Whist. .. 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 = 'python', include=None, exclude=None, context=None, by_alias = None, exclude_unset = False, exclude_defaults = False, exclude_none = False, round_trip = False, warnings = True, fallback = None, serialize_as_any = False) Overrides model_dump to ensure matcher is correctly dumped. .. 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: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:method:: next_rubber() Creates the next rubber. In order to create the first rubber use 'Table.start()'. :return: the new rubber .. py:method:: start() Starts the table, but will check if every player is ready first. .. py:method:: join(player) 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) Remove a player from table. :param player: The player to remove. :type player: Player :return: None :rtype: None .. py:method:: join_team(player, team) 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) Player says they is ready. :param player: player who is ready :type player: Player :return: None :rtype: None .. py:method:: player_unready(player) Player says they is not ready. :param player: player who is not ready :type player: Player :return: None :rtype: None .. py:method:: _create_rubber()