Skip to content

Players

Class to manage playerdata

ready property readonly

Ready state of all players (readonly)

score property readonly

Scores of all player (readonly)

__init__(self, seats) special

Parameters:

Name Type Description Default
seats list

List of Player Id's

required
Source code in game_sdk/players.py
def __init__(self, seats: list):
    """
    Arguments:
        seats: List of Player Id's
    """

    for seat in seats:
        self._ready[seat] = False
        self._score[seat] = 0

reset(self)

Reset ready state and score of all players to Fales e.q. 0

Source code in game_sdk/players.py
def reset(self):
    """
        Reset ready state and score of all players to `Fales` e.q. `0`
    """

    for key in self._ready.keys():
        self._ready[key] = False
        self._score[key] = 0

reset_ready(self)

Reset ready state of all players to False

Source code in game_sdk/players.py
def reset_ready(self):
    """
        Reset ready state of all players to `False`
    """

    for key in self._ready.keys():
        self._ready[key] = False

set_ready(self, seat, ready)

Set ready state for specific player

Parameters:

Name Type Description Default
seat int

Player Id

required
ready bool

Ready state

required
Source code in game_sdk/players.py
def set_ready(self, seat: int, ready: bool):
    """
        Set ready state for specific player

        Arguments:
            seat: Player Id
            ready: Ready state
    """

    self._ready[seat] = ready

set_score(self, seat, score)

Set score of specific player

Parameters:

Name Type Description Default
seat int

Player ID

required
score int

Value of the score

required
Source code in game_sdk/players.py
def set_score(self, seat: int, score: int):
    """
        Set score of specific player

        Arguments:
            seat: Player ID
            score: Value of the score
    """

    self._score[seat] = score
Back to top