Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
PlayerManager Class Reference

#include <player_manager.h>

Inheritance diagram for PlayerManager:
[legend]
Collaboration diagram for PlayerManager:
[legend]

Signals

void playerAdded (Player *player)
void playerRemoved (Player *player)
void activeLocalPlayerConceded ()
void activeLocalPlayerUnconceded ()
void playerConceded (int playerId)
void playerUnconceded (int playerId)
void playerCountChanged ()
void spectatorAdded (ServerInfo_PlayerProperties spectator)
void spectatorRemoved (int spectatorId, ServerInfo_User spectator)

Public Member Functions

 PlayerManager (AbstractGame *_game, int _localPlayerId, bool _localPlayerIsJudge, bool localPlayerIsSpectator)
bool isSpectator () const
bool isJudge () const
int getLocalPlayerId () const
const QMap< int, Player * > & getPlayers () const
int getPlayerCount () const
PlayergetActiveLocalPlayer (int activePlayer) const
bool isLocalPlayer (int playerId)
PlayeraddPlayer (int playerId, const ServerInfo_User &info)
void removePlayer (int playerId)
PlayergetPlayer (int playerId) const
void onPlayerConceded (int playerId, bool conceded)
bool isMainPlayerConceded () const
bool isLocalPlayer (int playerId) const
const QMap< int, ServerInfo_User > & getSpectators () const
ServerInfo_User getSpectator (int playerId) const
QString getSpectatorName (int spectatorId) const
void addSpectator (int spectatorId, const ServerInfo_PlayerProperties &prop)
void removeSpectator (int spectatorId)
AbstractGamegetGame () const

Public Attributes

AbstractGamegame
QMap< int, Player * > players
int localPlayerId
bool localPlayerIsJudge
bool localPlayerIsSpectator
QMap< int, ServerInfo_User > spectators

Constructor & Destructor Documentation

◆ PlayerManager()

PlayerManager::PlayerManager ( AbstractGame * _game,
int _localPlayerId,
bool _localPlayerIsJudge,
bool localPlayerIsSpectator )

Member Function Documentation

◆ activeLocalPlayerConceded

void PlayerManager::activeLocalPlayerConceded ( )
signal
Here is the caller graph for this function:

◆ activeLocalPlayerUnconceded

void PlayerManager::activeLocalPlayerUnconceded ( )
signal
Here is the caller graph for this function:

◆ addPlayer()

Player * PlayerManager::addPlayer ( int playerId,
const ServerInfo_User & info )
Here is the call graph for this function:

◆ addSpectator()

void PlayerManager::addSpectator ( int spectatorId,
const ServerInfo_PlayerProperties & prop )
inline
Here is the call graph for this function:

◆ getActiveLocalPlayer()

Player * PlayerManager::getActiveLocalPlayer ( int activePlayer) const
nodiscard
Here is the call graph for this function:

◆ getGame()

AbstractGame * PlayerManager::getGame ( ) const
inlinenodiscard
Here is the caller graph for this function:

◆ getLocalPlayerId()

int PlayerManager::getLocalPlayerId ( ) const
inlinenodiscard
Here is the caller graph for this function:

◆ getPlayer()

Player * PlayerManager::getPlayer ( int playerId) const
nodiscard
Here is the caller graph for this function:

◆ getPlayerCount()

int PlayerManager::getPlayerCount ( ) const
inlinenodiscard

◆ getPlayers()

const QMap< int, Player * > & PlayerManager::getPlayers ( ) const
inlinenodiscard

◆ getSpectator()

ServerInfo_User PlayerManager::getSpectator ( int playerId) const
inlinenodiscard

◆ getSpectatorName()

QString PlayerManager::getSpectatorName ( int spectatorId) const
inlinenodiscard

◆ getSpectators()

const QMap< int, ServerInfo_User > & PlayerManager::getSpectators ( ) const
inlinenodiscard

◆ isJudge()

bool PlayerManager::isJudge ( ) const
inlinenodiscard
Here is the caller graph for this function:

◆ isLocalPlayer() [1/2]

bool PlayerManager::isLocalPlayer ( int playerId)
Here is the caller graph for this function:

◆ isLocalPlayer() [2/2]

bool PlayerManager::isLocalPlayer ( int playerId) const
inlinenodiscard
Here is the call graph for this function:

◆ isMainPlayerConceded()

bool PlayerManager::isMainPlayerConceded ( ) const
nodiscard
Here is the call graph for this function:

◆ isSpectator()

bool PlayerManager::isSpectator ( ) const
inlinenodiscard

◆ onPlayerConceded()

void PlayerManager::onPlayerConceded ( int playerId,
bool conceded )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ playerAdded

void PlayerManager::playerAdded ( Player * player)
signal
Here is the caller graph for this function:

◆ playerConceded

void PlayerManager::playerConceded ( int playerId)
signal
Here is the caller graph for this function:

◆ playerCountChanged

void PlayerManager::playerCountChanged ( )
signal
Here is the caller graph for this function:

◆ playerRemoved

void PlayerManager::playerRemoved ( Player * player)
signal
Here is the caller graph for this function:

◆ playerUnconceded

void PlayerManager::playerUnconceded ( int playerId)
signal
Here is the caller graph for this function:

◆ removePlayer()

void PlayerManager::removePlayer ( int playerId)
Here is the call graph for this function:

◆ removeSpectator()

void PlayerManager::removeSpectator ( int spectatorId)
inline
Here is the call graph for this function:

◆ spectatorAdded

void PlayerManager::spectatorAdded ( ServerInfo_PlayerProperties spectator)
signal
Here is the caller graph for this function:

◆ spectatorRemoved

void PlayerManager::spectatorRemoved ( int spectatorId,
ServerInfo_User spectator )
signal
Here is the caller graph for this function:

Member Data Documentation

◆ game

AbstractGame* PlayerManager::game

◆ localPlayerId

int PlayerManager::localPlayerId

◆ localPlayerIsJudge

bool PlayerManager::localPlayerIsJudge

◆ localPlayerIsSpectator

bool PlayerManager::localPlayerIsSpectator

◆ players

QMap<int, Player *> PlayerManager::players

◆ spectators

QMap<int, ServerInfo_User> PlayerManager::spectators

The documentation for this class was generated from the following files: