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

#include <tab_game.h>

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

Public Slots

void viewCardInfo (const CardRef &cardRef={}) const
void resetChatAndPhase ()
void updateTimeElapsedLabel (QString newTime)
void addPlayerToAutoCompleteList (QString playerName)
void removePlayerFromAutoCompleteList (QString playerName)
void removeSpectator (int spectatorId, ServerInfo_User spectator)
void processLocalPlayerSideboardLocked (int playerId, bool sideboardLocked)
void processLocalPlayerReadyStateChanged (int playerId, bool ready)
void emitUserEvent ()

Signals

void gameClosing (TabGame *tab)
void containerProcessingStarted (const GameEventContext &context)
void containerProcessingDone ()
void openMessageDialog (const QString &userName, bool focus)
void openDeckEditor (DeckLoader *deck)
void notIdle ()
void phaseChanged (int phase)
void gameLeft ()
void chatMessageSent (QString chatMessage)
void turnAdvanced ()
void arrowDeletionRequested (int arrowId)
Signals inherited from Tab
void userEvent (bool globalEvent=true)
void tabTextChanged (Tab *tab, const QString &newTabText)

Public Member Functions

 TabGame (TabSupervisor *_tabSupervisor, QList< AbstractClient * > &_clients, const Event_GameJoined &event, const QMap< int, QString > &_roomGameTypes)
void connectToGameState ()
void connectToPlayerManager ()
void connectToGameEventHandler ()
void connectMessageLogToGameEventHandler ()
void connectPlayerListToGameEventHandler ()
 TabGame (TabSupervisor *_tabSupervisor, GameReplay *replay)
 ~TabGame () override
void retranslateUi () override
void updatePlayerListDockTitle ()
bool closeRequest () override
QString getTabText () const override
AbstractGamegetGame () const
Public Member Functions inherited from Tab
 Tab (TabSupervisor *_tabSupervisor)
const QList< QMenu * > & getTabMenus () const
TabSupervisorgetTabSupervisor () const
bool getContentsChanged () const
void setContentsChanged (bool _contentsChanged)
virtual void tabActivated ()

Protected Slots

void closeEvent (QCloseEvent *event) override
Protected Slots inherited from Tab
void showCardInfoPopup (const QPoint &pos, const CardRef &cardRef)
void deleteCardInfoPopup (const QString &cardName)

Private Slots

void adminLockChanged (bool lock)
void newCardAdded (AbstractCardItem *card)
void setCardMenu (QMenu *menu)
void actGameInfo ()
void actConcede ()
void actRemoveLocalArrows ()
void actRotateViewCW ()
void actRotateViewCCW ()
void actSay ()
void actPhaseAction ()
void actNextPhase ()
void actNextPhaseAction ()
void addMentionTag (const QString &value)
void linkCardToChat (const QString &cardName)
void refreshShortcuts ()
void loadLayout ()
void actCompleterChanged ()
void notifyPlayerJoin (QString playerName)
void notifyPlayerKicked ()
void processPlayerLeave (Player *leavingPlayer)
void actResetLayout ()
void freeDocksSize ()
void hideEvent (QHideEvent *event) override
bool eventFilter (QObject *o, QEvent *e) override
void dockVisibleTriggered ()
void dockFloatingTriggered ()
void dockTopLevelChanged (bool topLevel)

Private Member Functions

PlayeraddPlayer (Player *newPlayer)
void addLocalPlayer (Player *newPlayer, int playerId)
void processRemotePlayerDeckSelect (QString deckList, int playerId, QString playerName)
void processMultipleRemotePlayerDeckSelect (QVector< QPair< int, QPair< QString, QString > > > playerIdDeckMap)
void processLocalPlayerDeckSelect (Player *localPlayer, int playerId, ServerInfo_Player playerInfo)
void loadDeckForLocalPlayer (Player *localPlayer, int playerId, ServerInfo_Player playerInfo)
void processLocalPlayerReady (int playerId, ServerInfo_Player playerInfo)
void createZoneForPlayer (Player *newPlayer, int playerId)
void startGame (bool resuming)
void stopGame ()
void closeGame ()
bool leaveGame ()
PlayersetActivePlayer (int id)
void setActivePhase (int phase)
void createMenuItems ()
void createReplayMenuItems ()
void createViewMenuItems ()
void createCardInfoDock (bool bReplay=false)
void createPlayerListDock (bool bReplay=false)
void createMessageDock (bool bReplay=false)
void createPlayAreaWidget (bool bReplay=false)
void createDeckViewContainerWidget (bool bReplay=false)
void createReplayDock (GameReplay *replay)

Private Attributes

AbstractGamegame
const UserListProxyuserListProxy
ReplayManagerreplayManager
QStringList gameTypes
QCompleter * completer
QStringList autocompleteUserList
QStackedWidget * mainWidget
CardInfoFrameWidgetcardInfoFrameWidget
PlayerListWidgetplayerListWidget
QLabel * timeElapsedLabel
MessageLogWidgetmessageLog
QLabel * sayLabel
LineEditCompletersayEdit
PhasesToolbarphasesToolbar
GameScenescene
GameViewgameView
QMap< int, TabbedDeckViewContainer * > deckViewContainers
QVBoxLayout * deckViewContainerLayout
QWidget * gamePlayAreaWidget
QWidget * deckViewContainerWidget
QDockWidget * cardInfoDock
QDockWidget * messageLayoutDock
QDockWidget * playerListDock
QDockWidget * replayDock
QAction * playersSeparator
QMenu * gameMenu
QMenu * viewMenu
QMenu * cardInfoDockMenu
QMenu * messageLayoutDockMenu
QMenu * playerListDockMenu
QMenu * replayDockMenu
TearOffMenuphasesMenu
QAction * aGameInfo
QAction * aConcede
QAction * aLeaveGame
QAction * aNextPhase
QAction * aNextPhaseAction
QAction * aNextTurn
QAction * aReverseTurn
QAction * aRemoveLocalArrows
QAction * aRotateViewCW
QAction * aRotateViewCCW
QAction * aResetLayout
QAction * aResetReplayLayout
QAction * aCardInfoDockVisible
QAction * aCardInfoDockFloating
QAction * aMessageLayoutDockVisible
QAction * aMessageLayoutDockFloating
QAction * aPlayerListDockVisible
QAction * aPlayerListDockFloating
QAction * aReplayDockVisible
QAction * aReplayDockFloating
QAction * aFocusChat
QList< QAction * > phaseActions
QAction * aCardMenu

Additional Inherited Members

Protected Member Functions inherited from Tab
void addTabMenu (QMenu *menu)
Protected Attributes inherited from Tab
TabSupervisortabSupervisor

Constructor & Destructor Documentation

◆ TabGame() [1/2]

TabGame::TabGame ( TabSupervisor * _tabSupervisor,
QList< AbstractClient * > & _clients,
const Event_GameJoined & event,
const QMap< int, QString > & _roomGameTypes )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ TabGame() [2/2]

TabGame::TabGame ( TabSupervisor * _tabSupervisor,
GameReplay * replay )
Here is the call graph for this function:

◆ ~TabGame()

TabGame::~TabGame ( )
override

Member Function Documentation

◆ actCompleterChanged

void TabGame::actCompleterChanged ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actConcede

void TabGame::actConcede ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actGameInfo

void TabGame::actGameInfo ( )
privateslot
Here is the caller graph for this function:

◆ actNextPhase

void TabGame::actNextPhase ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actNextPhaseAction

void TabGame::actNextPhaseAction ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actPhaseAction

void TabGame::actPhaseAction ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actRemoveLocalArrows

void TabGame::actRemoveLocalArrows ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actResetLayout

void TabGame::actResetLayout ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actRotateViewCCW

void TabGame::actRotateViewCCW ( )
privateslot
Here is the caller graph for this function:

◆ actRotateViewCW

void TabGame::actRotateViewCW ( )
privateslot
Here is the caller graph for this function:

◆ actSay

void TabGame::actSay ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addLocalPlayer()

void TabGame::addLocalPlayer ( Player * newPlayer,
int playerId )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addMentionTag

void TabGame::addMentionTag ( const QString & value)
privateslot
Here is the caller graph for this function:

◆ addPlayer()

Player * TabGame::addPlayer ( Player * newPlayer)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addPlayerToAutoCompleteList

void TabGame::addPlayerToAutoCompleteList ( QString playerName)
slot
Here is the caller graph for this function:

◆ adminLockChanged

void TabGame::adminLockChanged ( bool lock)
privateslot
Here is the caller graph for this function:

◆ arrowDeletionRequested

void TabGame::arrowDeletionRequested ( int arrowId)
signal
Here is the caller graph for this function:

◆ chatMessageSent

void TabGame::chatMessageSent ( QString chatMessage)
signal
Here is the caller graph for this function:

◆ closeEvent

void TabGame::closeEvent ( QCloseEvent * event)
overrideprotectedslot
Here is the call graph for this function:

◆ closeGame()

void TabGame::closeGame ( )
private
Here is the caller graph for this function:

◆ closeRequest()

bool TabGame::closeRequest ( )
overridevirtual

Nicely asks to close the tab. Override this method to do checks or ask for confirmation before closing the tab. If you need to force close the tab, just call close() instead.

Returns
True if the tab is successfully closed.

Reimplemented from Tab.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ connectMessageLogToGameEventHandler()

void TabGame::connectMessageLogToGameEventHandler ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ connectPlayerListToGameEventHandler()

void TabGame::connectPlayerListToGameEventHandler ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ connectToGameEventHandler()

void TabGame::connectToGameEventHandler ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ connectToGameState()

void TabGame::connectToGameState ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ connectToPlayerManager()

void TabGame::connectToPlayerManager ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ containerProcessingDone

void TabGame::containerProcessingDone ( )
signal

◆ containerProcessingStarted

void TabGame::containerProcessingStarted ( const GameEventContext & context)
signal

◆ createCardInfoDock()

void TabGame::createCardInfoDock ( bool bReplay = false)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createDeckViewContainerWidget()

void TabGame::createDeckViewContainerWidget ( bool bReplay = false)
private
Here is the caller graph for this function:

◆ createMenuItems()

void TabGame::createMenuItems ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createMessageDock()

void TabGame::createMessageDock ( bool bReplay = false)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createPlayAreaWidget()

void TabGame::createPlayAreaWidget ( bool bReplay = false)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createPlayerListDock()

void TabGame::createPlayerListDock ( bool bReplay = false)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createReplayDock()

void TabGame::createReplayDock ( GameReplay * replay)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createReplayMenuItems()

void TabGame::createReplayMenuItems ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createViewMenuItems()

void TabGame::createViewMenuItems ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createZoneForPlayer()

void TabGame::createZoneForPlayer ( Player * newPlayer,
int playerId )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dockFloatingTriggered

void TabGame::dockFloatingTriggered ( )
privateslot
Here is the caller graph for this function:

◆ dockTopLevelChanged

void TabGame::dockTopLevelChanged ( bool topLevel)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dockVisibleTriggered

void TabGame::dockVisibleTriggered ( )
privateslot
Here is the caller graph for this function:

◆ emitUserEvent

void TabGame::emitUserEvent ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eventFilter

bool TabGame::eventFilter ( QObject * o,
QEvent * e )
overrideprivateslot

◆ freeDocksSize

void TabGame::freeDocksSize ( )
privateslot
Here is the caller graph for this function:

◆ gameClosing

void TabGame::gameClosing ( TabGame * tab)
signal
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gameLeft

void TabGame::gameLeft ( )
signal
Here is the caller graph for this function:

◆ getGame()

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

◆ getTabText()

QString TabGame::getTabText ( ) const
nodiscardoverridevirtual

Implements Tab.

Here is the caller graph for this function:

◆ hideEvent

void TabGame::hideEvent ( QHideEvent * event)
overrideprivateslot
Here is the call graph for this function:

◆ leaveGame()

bool TabGame::leaveGame ( )
private

Confirms the leave game and sends the leave game command, if applicable.

Returns
True if the leave game is confirmed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ linkCardToChat

void TabGame::linkCardToChat ( const QString & cardName)
privateslot
Here is the caller graph for this function:

◆ loadDeckForLocalPlayer()

void TabGame::loadDeckForLocalPlayer ( Player * localPlayer,
int playerId,
ServerInfo_Player playerInfo )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadLayout

void TabGame::loadLayout ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ newCardAdded

void TabGame::newCardAdded ( AbstractCardItem * card)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ notIdle

void TabGame::notIdle ( )
signal

◆ notifyPlayerJoin

void TabGame::notifyPlayerJoin ( QString playerName)
privateslot

◆ notifyPlayerKicked

void TabGame::notifyPlayerKicked ( )
privateslot
Here is the call graph for this function:

◆ openDeckEditor

void TabGame::openDeckEditor ( DeckLoader * deck)
signal
Here is the caller graph for this function:

◆ openMessageDialog

void TabGame::openMessageDialog ( const QString & userName,
bool focus )
signal
Here is the caller graph for this function:

◆ phaseChanged

void TabGame::phaseChanged ( int phase)
signal
Here is the caller graph for this function:

◆ processLocalPlayerDeckSelect()

void TabGame::processLocalPlayerDeckSelect ( Player * localPlayer,
int playerId,
ServerInfo_Player playerInfo )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processLocalPlayerReady()

void TabGame::processLocalPlayerReady ( int playerId,
ServerInfo_Player playerInfo )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processLocalPlayerReadyStateChanged

void TabGame::processLocalPlayerReadyStateChanged ( int playerId,
bool ready )
slot
Here is the caller graph for this function:

◆ processLocalPlayerSideboardLocked

void TabGame::processLocalPlayerSideboardLocked ( int playerId,
bool sideboardLocked )
slot
Here is the caller graph for this function:

◆ processMultipleRemotePlayerDeckSelect()

void TabGame::processMultipleRemotePlayerDeckSelect ( QVector< QPair< int, QPair< QString, QString > > > playerIdDeckMap)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processPlayerLeave

void TabGame::processPlayerLeave ( Player * leavingPlayer)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processRemotePlayerDeckSelect()

void TabGame::processRemotePlayerDeckSelect ( QString deckList,
int playerId,
QString playerName )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ refreshShortcuts

void TabGame::refreshShortcuts ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removePlayerFromAutoCompleteList

void TabGame::removePlayerFromAutoCompleteList ( QString playerName)
slot
Here is the caller graph for this function:

◆ removeSpectator

void TabGame::removeSpectator ( int spectatorId,
ServerInfo_User spectator )
slot
Here is the call graph for this function:

◆ resetChatAndPhase

void TabGame::resetChatAndPhase ( )
slot
Here is the caller graph for this function:

◆ retranslateUi()

void TabGame::retranslateUi ( )
overridevirtual

Implements Tab.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setActivePhase()

void TabGame::setActivePhase ( int phase)
private
Here is the caller graph for this function:

◆ setActivePlayer()

Player * TabGame::setActivePlayer ( int id)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCardMenu

void TabGame::setCardMenu ( QMenu * menu)
privateslot
Parameters
menuThe menu to set. Pass in nullptr to set the menu to empty.
Here is the caller graph for this function:

◆ startGame()

void TabGame::startGame ( bool resuming)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopGame()

void TabGame::stopGame ( )
private
Here is the caller graph for this function:

◆ turnAdvanced

void TabGame::turnAdvanced ( )
signal
Here is the caller graph for this function:

◆ updatePlayerListDockTitle()

void TabGame::updatePlayerListDockTitle ( )
Here is the caller graph for this function:

◆ updateTimeElapsedLabel

void TabGame::updateTimeElapsedLabel ( QString newTime)
slot
Here is the caller graph for this function:

◆ viewCardInfo

void TabGame::viewCardInfo ( const CardRef & cardRef = {}) const
slot

Member Data Documentation

◆ aCardInfoDockFloating

QAction * TabGame::aCardInfoDockFloating
private

◆ aCardInfoDockVisible

QAction* TabGame::aCardInfoDockVisible
private

◆ aCardMenu

QAction* TabGame::aCardMenu
private

◆ aConcede

QAction * TabGame::aConcede
private

◆ aFocusChat

QAction* TabGame::aFocusChat
private

◆ aGameInfo

QAction* TabGame::aGameInfo
private

◆ aLeaveGame

QAction * TabGame::aLeaveGame
private

◆ aMessageLayoutDockFloating

QAction * TabGame::aMessageLayoutDockFloating
private

◆ aMessageLayoutDockVisible

QAction * TabGame::aMessageLayoutDockVisible
private

◆ aNextPhase

QAction * TabGame::aNextPhase
private

◆ aNextPhaseAction

QAction * TabGame::aNextPhaseAction
private

◆ aNextTurn

QAction * TabGame::aNextTurn
private

◆ aPlayerListDockFloating

QAction * TabGame::aPlayerListDockFloating
private

◆ aPlayerListDockVisible

QAction * TabGame::aPlayerListDockVisible
private

◆ aRemoveLocalArrows

QAction * TabGame::aRemoveLocalArrows
private

◆ aReplayDockFloating

QAction * TabGame::aReplayDockFloating
private

◆ aReplayDockVisible

QAction * TabGame::aReplayDockVisible
private

◆ aResetLayout

QAction * TabGame::aResetLayout
private

◆ aResetReplayLayout

QAction * TabGame::aResetReplayLayout
private

◆ aReverseTurn

QAction * TabGame::aReverseTurn
private

◆ aRotateViewCCW

QAction * TabGame::aRotateViewCCW
private

◆ aRotateViewCW

QAction * TabGame::aRotateViewCW
private

◆ autocompleteUserList

QStringList TabGame::autocompleteUserList
private

◆ cardInfoDock

QDockWidget* TabGame::cardInfoDock
private

◆ cardInfoDockMenu

QMenu * TabGame::cardInfoDockMenu
private

◆ cardInfoFrameWidget

CardInfoFrameWidget* TabGame::cardInfoFrameWidget
private

◆ completer

QCompleter* TabGame::completer
private

◆ deckViewContainerLayout

QVBoxLayout* TabGame::deckViewContainerLayout
private

◆ deckViewContainers

QMap<int, TabbedDeckViewContainer *> TabGame::deckViewContainers
private

◆ deckViewContainerWidget

QWidget * TabGame::deckViewContainerWidget
private

◆ game

AbstractGame* TabGame::game
private

◆ gameMenu

QMenu* TabGame::gameMenu
private

◆ gamePlayAreaWidget

QWidget* TabGame::gamePlayAreaWidget
private

◆ gameTypes

QStringList TabGame::gameTypes
private

◆ gameView

GameView* TabGame::gameView
private

◆ mainWidget

QStackedWidget* TabGame::mainWidget
private

◆ messageLayoutDock

QDockWidget * TabGame::messageLayoutDock
private

◆ messageLayoutDockMenu

QMenu * TabGame::messageLayoutDockMenu
private

◆ messageLog

MessageLogWidget* TabGame::messageLog
private

◆ phaseActions

QList<QAction *> TabGame::phaseActions
private

◆ phasesMenu

TearOffMenu* TabGame::phasesMenu
private

◆ phasesToolbar

PhasesToolbar* TabGame::phasesToolbar
private

◆ playerListDock

QDockWidget * TabGame::playerListDock
private

◆ playerListDockMenu

QMenu * TabGame::playerListDockMenu
private

◆ playerListWidget

PlayerListWidget* TabGame::playerListWidget
private

◆ playersSeparator

QAction* TabGame::playersSeparator
private

◆ replayDock

QDockWidget * TabGame::replayDock
private

◆ replayDockMenu

QMenu * TabGame::replayDockMenu
private

◆ replayManager

ReplayManager* TabGame::replayManager
private

◆ sayEdit

LineEditCompleter* TabGame::sayEdit
private

◆ sayLabel

QLabel* TabGame::sayLabel
private

◆ scene

GameScene* TabGame::scene
private

◆ timeElapsedLabel

QLabel* TabGame::timeElapsedLabel
private

◆ userListProxy

const UserListProxy* TabGame::userListProxy
private

◆ viewMenu

QMenu * TabGame::viewMenu
private

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