From b437d8f7d2adbb241d3a29ead43d4f11a282be1c Mon Sep 17 00:00:00 2001 From: floty Date: Sun, 7 Oct 2007 11:12:02 +0000 Subject: [PATCH] firstRunGui --- src/engine/berointerface.h | 2 +- src/engine/local_engine/localbero.cpp | 12 ++++++++---- src/engine/local_engine/localbero.h | 3 ++- src/engine/network_engine/clientbero.cpp | 2 +- src/engine/network_engine/clientbero.h | 2 +- src/net/common/servergamestate.cpp | 6 +++--- 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/engine/berointerface.h b/src/engine/berointerface.h index e9e430c1..1f82d342 100644 --- a/src/engine/berointerface.h +++ b/src/engine/berointerface.h @@ -58,7 +58,7 @@ public: virtual bool getFirstRound() const =0; - virtual void resetFirstRun() =0; + virtual void skipFirstRunGui() =0; virtual void nextPlayer() =0; virtual void run() =0; diff --git a/src/engine/local_engine/localbero.cpp b/src/engine/local_engine/localbero.cpp index 8e150e25..3f0c52d3 100644 --- a/src/engine/local_engine/localbero.cpp +++ b/src/engine/local_engine/localbero.cpp @@ -14,7 +14,7 @@ using namespace std; LocalBeRo::LocalBeRo(HandInterface* hi, int id, unsigned dP, int sB, GameState gS) -: BeRoInterface(), myHand(hi), myBeRoID(gS), myID(id), dealerPosition(dP), smallBlindPosition(0), dealerPositionId(dP), smallBlindPositionId(0), bigBlindPositionId(0), smallBlind(sB), highestSet(false), minimumRaise(2*sB), firstRun(true), firstRound(true), firstHeadsUpRound(true), currentPlayersTurnId(0), firstRoundLastPlayersTurnId(0), logBoardCardsDone(false) +: BeRoInterface(), myHand(hi), myBeRoID(gS), myID(id), dealerPosition(dP), smallBlindPosition(0), dealerPositionId(dP), smallBlindPositionId(0), bigBlindPositionId(0), smallBlind(sB), highestSet(false), minimumRaise(2*sB), firstRun(true), firstRunGui(true), firstRound(true), firstHeadsUpRound(true), currentPlayersTurnId(0), firstRoundLastPlayersTurnId(0), logBoardCardsDone(false) { currentPlayersTurnIt = myHand->getRunningPlayerList()->begin(); lastPlayersTurnIt = myHand->getRunningPlayerList()->begin(); @@ -92,11 +92,15 @@ void LocalBeRo::nextPlayer() { void LocalBeRo::run() { - if (firstRun) { + if (firstRun || firstRunGui) { + + // HACK + if(firstRunGui) { + firstRunGui = false; + myHand->getGuiInterface()->dealBeRoCards(myBeRoID); + } - myHand->getGuiInterface()->dealBeRoCards(myBeRoID); firstRun = false; - /* // determine smallBlindPosition diff --git a/src/engine/local_engine/localbero.h b/src/engine/local_engine/localbero.h index e275586c..99e8be2c 100644 --- a/src/engine/local_engine/localbero.h +++ b/src/engine/local_engine/localbero.h @@ -35,7 +35,7 @@ public: void setMinimumRaise ( int theValue ) { minimumRaise = theValue; } int getMinimumRaise() const { return minimumRaise; } - void resetFirstRun() { firstRun = false; } + void skipFirstRunGui() { firstRunGui = false; } void nextPlayer(); void run(); @@ -116,6 +116,7 @@ private: int minimumRaise; bool firstRun; + bool firstRunGui; // HACK bool firstRound; bool firstHeadsUpRound; diff --git a/src/engine/network_engine/clientbero.cpp b/src/engine/network_engine/clientbero.cpp index b6c0b874..483cfb8a 100644 --- a/src/engine/network_engine/clientbero.cpp +++ b/src/engine/network_engine/clientbero.cpp @@ -223,7 +223,7 @@ ClientBeRo::getMinimumRaise() const void -ClientBeRo::resetFirstRun() +ClientBeRo::skipFirstRunGui() { } diff --git a/src/engine/network_engine/clientbero.h b/src/engine/network_engine/clientbero.h index 0ac15e02..e37e4682 100644 --- a/src/engine/network_engine/clientbero.h +++ b/src/engine/network_engine/clientbero.h @@ -70,7 +70,7 @@ public: int getMinimumRaise() const; - void resetFirstRun(); + void skipFirstRunGui(); void nextPlayer(); void run(); diff --git a/src/net/common/servergamestate.cpp b/src/net/common/servergamestate.cpp index 52dc8c09..9bb87b7a 100644 --- a/src/net/common/servergamestate.cpp +++ b/src/net/common/servergamestate.cpp @@ -440,9 +440,9 @@ ServerGameStateStartHand::Process(ServerGameThread &server) curGame.initHand(); // HACK: Skip GUI notification run - curGame.getCurrentHand()->getFlop()->resetFirstRun(); - curGame.getCurrentHand()->getTurn()->resetFirstRun(); - curGame.getCurrentHand()->getRiver()->resetFirstRun(); + curGame.getCurrentHand()->getFlop()->skipFirstRunGui(); + curGame.getCurrentHand()->getTurn()->skipFirstRunGui(); + curGame.getCurrentHand()->getRiver()->skipFirstRunGui(); // Consider all players, even inactive. PlayerListIterator i = curGame.getSeatsList()->begin();