whist_core.user.player
DAO of user.
Classes
This is the server side class of an user. |
Module Contents
- class whist_core.user.player.Player
Bases:
whist_core.user.user.UserThis is the server side class of an user.
- games: int = 0
- rating: int
- __str__()
Returns string representation of the player.
- __hash__()
Returns the hash value of the player object.
- __eq__(other)
Checks if the other is the same player.
- classmethod rating_must_not_be_negative(value)
Validates the rating. It must be zero or positive.
- static get_player(database, username)
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
- Parameters:
database (dict)
username (str)
- Return type:
Optional[Player]