Resetting cards value on client side each hand. Added GUI synchronization function. Fixed update of pot when all but one fold. Reset sets on end of hand.
This commit is contained in:
@@ -62,6 +62,8 @@ void ServerGuiWrapper::refreshPlayerName() const {}
|
||||
void ServerGuiWrapper::refreshButton() const {}
|
||||
void ServerGuiWrapper::refreshGameLabels(GameState state) const {}
|
||||
|
||||
void ServerGuiWrapper::waitForGuiUpdateDone() const {}
|
||||
|
||||
void ServerGuiWrapper::dealHoleCards() {}
|
||||
void ServerGuiWrapper::dealFlopCards() {}
|
||||
void ServerGuiWrapper::dealTurnCard() {}
|
||||
|
||||
@@ -46,6 +46,8 @@ public:
|
||||
void refreshButton() const;
|
||||
void refreshGameLabels(GameState state) const;
|
||||
|
||||
void waitForGuiUpdateDone() const;
|
||||
|
||||
void dealHoleCards();
|
||||
void dealFlopCards();
|
||||
void dealTurnCard();
|
||||
|
||||
@@ -51,6 +51,8 @@ public:
|
||||
virtual void refreshButton() const =0;
|
||||
virtual void refreshGameLabels(GameState state) const=0;
|
||||
|
||||
virtual void waitForGuiUpdateDone() const=0;
|
||||
|
||||
// // Karten-Funktionen
|
||||
virtual void dealHoleCards()=0;
|
||||
virtual void dealFlopCards()=0;
|
||||
|
||||
@@ -60,6 +60,12 @@ void GuiWrapper::refreshPlayerName() const { myW->signalRefreshPlayerName(); }
|
||||
void GuiWrapper::refreshButton() const { myW->signalRefreshButton(); }
|
||||
void GuiWrapper::refreshGameLabels(GameState state) const { myW->signalRefreshGameLabels(state); }
|
||||
|
||||
void GuiWrapper::waitForGuiUpdateDone() const
|
||||
{
|
||||
myW->signalGuiUpdateDone();
|
||||
myW->waitForGuiUpdateDone();
|
||||
}
|
||||
|
||||
void GuiWrapper::dealHoleCards() { myW->signalDealHoleCards(); }
|
||||
void GuiWrapper::dealFlopCards() { myW->signalDealFlopCards0(); }
|
||||
void GuiWrapper::dealTurnCard() { myW->signalDealTurnCards0(); }
|
||||
|
||||
@@ -53,6 +53,8 @@ public:
|
||||
void refreshButton() const;
|
||||
void refreshGameLabels(GameState state) const;
|
||||
|
||||
void waitForGuiUpdateDone() const;
|
||||
|
||||
void dealHoleCards();
|
||||
void dealFlopCards();
|
||||
void dealTurnCard();
|
||||
|
||||
@@ -584,6 +584,8 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
|
||||
connect(this, SIGNAL(signalRefreshButton()), this, SLOT(refreshButton()));
|
||||
connect(this, SIGNAL(signalRefreshGameLabels(int)), this, SLOT(refreshGameLabels(int)));
|
||||
|
||||
connect(this, SIGNAL(signalGuiUpdateDone()), this, SLOT(guiUpdateDone()));
|
||||
|
||||
connect(this, SIGNAL(signalMeInAction()), this, SLOT(meInAction()));
|
||||
connect(this, SIGNAL(signalDisableMyButtons()), this, SLOT(disableMyButtons()));
|
||||
connect(this, SIGNAL(signalStartTimeoutAnimation(int, int)), this, SLOT(startTimeoutAnimation(int, int)));
|
||||
@@ -1251,6 +1253,14 @@ void mainWindowImpl::refreshPot() {
|
||||
textLabel_Pot->setText("<span style='font-weight:bold'>"+QString::number(currentHand->getBoard()->getPot(),10)+" $</span>");
|
||||
}
|
||||
|
||||
void mainWindowImpl::guiUpdateDone() {
|
||||
guiUpdateSemaphore.release();
|
||||
}
|
||||
|
||||
void mainWindowImpl::waitForGuiUpdateDone() {
|
||||
guiUpdateSemaphore.acquire();
|
||||
}
|
||||
|
||||
void mainWindowImpl::dealHoleCards() {
|
||||
|
||||
QPixmap onePix(":/graphics/resources/graphics/1px.png");
|
||||
|
||||
@@ -85,6 +85,8 @@ signals:
|
||||
void signalRefreshButton();
|
||||
void signalRefreshGameLabels(int);
|
||||
|
||||
void signalGuiUpdateDone();
|
||||
|
||||
void signalMeInAction();
|
||||
void signalDisableMyButtons();
|
||||
void signalStartTimeoutAnimation(int playerId, int timeoutSec);
|
||||
@@ -140,6 +142,9 @@ public slots:
|
||||
void refreshButton();
|
||||
void refreshPlayerAvatar();
|
||||
|
||||
void guiUpdateDone();
|
||||
void waitForGuiUpdateDone();
|
||||
|
||||
// Karten-Funktionen
|
||||
void dealHoleCards();
|
||||
|
||||
@@ -390,7 +395,7 @@ private:
|
||||
// statistic testing
|
||||
int statisticArray[15];
|
||||
|
||||
|
||||
QSemaphore guiUpdateSemaphore;
|
||||
|
||||
friend class GuiWrapper;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user