whist_core.user.player ====================== .. py:module:: whist_core.user.player .. autoapi-nested-parse:: DAO of user. Classes ------- .. autoapisummary:: whist_core.user.player.Player Module Contents --------------- .. py:class:: Player Bases: :py:obj:`whist_core.user.user.User` This is the server side class of an user. .. py:attribute:: games :type: int :value: 0 .. py:attribute:: rating :type: int .. py:method:: __str__() Returns string representation of the player. .. py:method:: __hash__() Returns the hash value of the player object. .. py:method:: __eq__(other) Checks if the other is the same player. .. py:method:: rating_must_not_be_negative(value) :classmethod: Validates the rating. It must be zero or positive. .. py:method:: get_player(database, username) :staticmethod: Returns a player for a given username if they are in the given database. :param database: where to look for the user :type database: dictionary :param username: the name of the user to look for :type username: string :return: The player instance or None :rtype: Player or None