Trabalho Prático - PDS2
Carregando...
Procurando...
Nenhuma entrada encontrado
Referência da Classe Player
Diagrama de colaboração para Player:

Membros Públicos

 Player (int id, std::string name, std::string nickname, Stats stats)
 
 Player (int id, std::string name, std::string nickname)
 
int getId () const
 
std::string getNickname () const
 
std::string getName () const
 
void setNickname (std::string nickname)
 
void setName (std::string name)
 
Stats getStats () const
 
void updateStats (char result, char game)
 Updates the player's statistics based on the result of a game.
 

Membros privados

void updateGameStats (char game, bool isWin)
 Updates the game statistics for the player based on the game type and result.
 

Atributos Privados

int _id
 
std::string _name
 
std::string _nickname
 
Stats _stats
 

Amigos

std::ostream & operator<< (std::ostream &os, const Player &player)
 

Documentação das funções

◆ updateGameStats()

void updateGameStats ( char game,
bool isWin )
private

Updates the game statistics for the player based on the game type and result.

Parâmetros
gameA character representing the game type: 'T' for Tic-Tac-Toe, 'L' for Connect Four (Lig4), 'R' for Reversi.
isWinA boolean indicating whether the player won the game (true) or lost the game (false).
Esse é o diagrama das funções que utilizam essa função:

◆ updateStats()

void updateStats ( char result,
char game )

Updates the player's statistics based on the result of a game.

Parâmetros
resultA character representing the result of the game: 'W' for a win, 'L' for a loss, 'D' for a draw.
gameA character representing the type of game played.
Exceções
InvalidInputExceptionif the result character is not 'W', 'L', or 'D'.
Este é o diagrama das funções utilizadas por essa função:
Esse é o diagrama das funções que utilizam essa função:

A documentação para essa classe foi gerada a partir dos seguintes arquivos: