From 876508c5403a95d4a492964209e13f823173c062 Mon Sep 17 00:00:00 2001 From: doitux Date: Mon, 24 Sep 2007 14:57:37 +0000 Subject: [PATCH] adds activePlayerList and runningPlayerList (III) --- src/engine/local_engine/localhand.cpp | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/engine/local_engine/localhand.cpp b/src/engine/local_engine/localhand.cpp index c9473fac..1cd821ca 100755 --- a/src/engine/local_engine/localhand.cpp +++ b/src/engine/local_engine/localhand.cpp @@ -365,9 +365,15 @@ void LocalHand::switchRounds() { for (it=activePlayerList.begin(); it!=activePlayerList.end(); it++) { if ((*it)->getMyAction() == 6) allInPlayersCounter++; } - + + // TODO -> runningPlayerList.size() + int nonFoldPlayerCounter = 0; + for (it=activePlayerList.begin(); it!=activePlayerList.end(); it++) { + if ((*it)->getMyAction() != 1) nonFoldPlayerCounter++; + } + //wenn nur noch einer nicht-folded dann gleich den Pot verteilen - if(activePlayerList.size()==1) { + if(nonFoldPlayerCounter==1) { myBoard->collectPot(); myGui->refreshPot(); myGui->refreshSet(); @@ -378,17 +384,26 @@ void LocalHand::switchRounds() { else { // 1) wenn alle All In - if(allInPlayersCounter == activePlayerList.size()) { + if(allInPlayersCounter == nonFoldPlayerCounter) { allInCondition = true; } // 2) alle bis auf einen All In und der hat HighestSet - if(allInPlayersCounter+1 == activePlayerList.size()) { + if(allInPlayersCounter+1 == nonFoldPlayerCounter) { + + // TODO -> runningPlayerList s.u. + for(i=0; igetMyAction() != 1 && playerArray[i]->getMyAction() != 6 && playerArray[i]->getMyActiveStatus() == 1 && playerArray[i]->getMySet() >= myBeRo[actualRound]->getHighestSet()) { + allInCondition = 1; + } - if( (*(runningPlayerList.begin()))->getMySet() >= myBeRo[actualRound]->getHighestSet() ) { - allInCondition = 1; } +// if( (*(runningPlayerList.begin()))->getMySet() >= myBeRo[actualRound]->getHighestSet() ) { +// allInCondition = 1; +// } + // HeadsUp-Ausnahme -> spieler ermitteln, der all in ist und als bb nur weniger als sb setzen konnte for(i=0; i