From 390837f332bd0c2f95432c194b25717048185262 Mon Sep 17 00:00:00 2001 From: doitux Date: Sat, 29 Sep 2007 13:22:00 +0000 Subject: [PATCH] adds activePlayerList and runningPlayerList (XXIII) - bugfixes --- src/engine/local_engine/localbero.h | 3 ++ src/engine/local_engine/localberopreflop.cpp | 41 +++++++++++++++++--- src/engine/local_engine/localhand.cpp | 1 + src/game.cpp | 20 +++++----- 4 files changed, 50 insertions(+), 15 deletions(-) diff --git a/src/engine/local_engine/localbero.h b/src/engine/local_engine/localbero.h index ab6cfb07..e275586c 100644 --- a/src/engine/local_engine/localbero.h +++ b/src/engine/local_engine/localbero.h @@ -68,6 +68,9 @@ protected: void setHighestSet(int theValue) { highestSet = theValue; } int getHighestSet() const { return highestSet;} + void setFirstRun(bool theValue) { firstRun = theValue;} + bool getFirstRun() const { return firstRun;} + void setFirstRound(bool theValue) { firstRound = theValue;} bool getFirstRound() const { return firstRound;} diff --git a/src/engine/local_engine/localberopreflop.cpp b/src/engine/local_engine/localberopreflop.cpp index 2869ce71..b823f847 100644 --- a/src/engine/local_engine/localberopreflop.cpp +++ b/src/engine/local_engine/localberopreflop.cpp @@ -30,6 +30,31 @@ LocalBeRoPreflop::LocalBeRoPreflop(HandInterface* hi, int id, unsigned dP, int s setHighestSet(2*getSmallBlind()); + + + +} + + + +LocalBeRoPreflop::~LocalBeRoPreflop() +{ + + + +} + +void LocalBeRoPreflop::run() { + + if(getFirstRun()) { + + + + + + + + // determine bigBlindPosition -> old: delete // for(bigBlindPositionIt=getMyHand()->getActivePlayerList()->begin(); bigBlindPositionIt!=getMyHand()->getActivePlayerList()->end(); bigBlindPositionIt++) { // if((*bigBlindPositionIt)->getMyButton() == BUTTON_BIG_BLIND) break; @@ -150,18 +175,22 @@ LocalBeRoPreflop::LocalBeRoPreflop(HandInterface* hi, int id, unsigned dP, int s -} -LocalBeRoPreflop::~LocalBeRoPreflop() -{ -} -void LocalBeRoPreflop::run() { + setFirstRun(false); + } + + + + + + + int i; bool allHighestSet = true; @@ -262,6 +291,8 @@ void LocalBeRoPreflop::run() { // } // } +// cout << "firstRound. " << getFirstRound() << " - allHighestSet: " << allHighestSet << endl; + // prfen, ob Preflop wirklich dran ist if(!getFirstRound() && allHighestSet) { diff --git a/src/engine/local_engine/localhand.cpp b/src/engine/local_engine/localhand.cpp index eb47d26c..89516c03 100755 --- a/src/engine/local_engine/localhand.cpp +++ b/src/engine/local_engine/localhand.cpp @@ -485,6 +485,7 @@ void LocalHand::switchRounds() { // refresh runningPlayerList for(it=runningPlayerList->begin(); it!=runningPlayerList->end(); ) { if((*it)->getMyAction() == PLAYER_ACTION_FOLD || (*it)->getMyAction() == PLAYER_ACTION_ALLIN) { + it = runningPlayerList->erase(it); if(!(runningPlayerList->empty())) { diff --git a/src/game.cpp b/src/game.cpp index 452abf74..1d16fdf6 100755 --- a/src/game.cpp +++ b/src/game.cpp @@ -266,7 +266,7 @@ void Game::raiseBlinds() { raiseBlinds = true; lastHandBlindsRaised = actualHandID; - cout << "raise now on hands \n"; +// cout << "raise now on hands \n"; } } else { @@ -274,7 +274,7 @@ void Game::raiseBlinds() { raiseBlinds = true; lastTimeBlindsRaised = blindsTimer.elapsed().total_seconds()/60; - cout << "raise now on minutes \n"; +// cout << "raise now on minutes \n"; } } @@ -285,7 +285,7 @@ void Game::raiseBlinds() { if (myGameData.raiseMode == DOUBLE_BLINDS) { actualSmallBlind *= 2; - cout << "double small blind \n"; +// cout << "double small blind \n"; } else { // Increase the position of the list @@ -296,35 +296,35 @@ void Game::raiseBlinds() { it = find(blindsList.begin(), blindsList.end(), actualSmallBlind); if(it != blindsList.end()) { it++; - cout << "increase position in blindslist \n"; +// cout << "increase position in blindslist \n"; } else { - cout << "blindslist exceeds\n"; +// cout << "blindslist exceeds\n"; if(actualSmallBlind == myGameData.firstSmallBlind) { it = blindsList.begin(); } } } - else { cout << "blindslist is empty \n"; } +// else { cout << "blindslist is empty \n"; } // Check if we can get an element of the list or the position exceeds the lis if (blindsList.empty() || it == blindsList.end()) { // The position exceeds the list if (myGameData.afterManualBlindsMode == AFTERMB_DOUBLE_BLINDS) { actualSmallBlind *= 2; - cout << "after blindslist double blind\n"; +// cout << "after blindslist double blind\n"; } else { if(myGameData.afterManualBlindsMode == AFTERMB_RAISE_ABOUT) { actualSmallBlind += myGameData.afterMBAlwaysRaiseValue; - cout << "after blindslist increase about x \n"; +// cout << "after blindslist increase about x \n"; } - else { /* Stay at last blind */ cout << "after blindslist stay at last blind \n"; } +// else { /* Stay at last blind */ cout << "after blindslist stay at last blind \n"; } } } else { // Grab the blinds amount from the list actualSmallBlind = *it; - cout << "set new small blind from blindslist \n"; +// cout << "set new small blind from blindslist \n"; } } }