log side pot winners and player sits out

This commit is contained in:
floty
2007-10-17 14:46:20 +00:00
parent e37321148b
commit a372f614e5
15 changed files with 108 additions and 27 deletions
+15 -1
View File
@@ -73,6 +73,8 @@ void LocalBoard::collectPot() {
void LocalBoard::distributePot() {
winners.clear();
size_t i,j,k,l;
PlayerListIterator it;
PlayerListConstIterator it_c;
@@ -177,11 +179,14 @@ void LocalBoard::distributePot() {
throw LocalException(ERR_SEAT_NOT_FOUND);
}
(*it)->setMyCash( (*it)->getMyCash() + ((potLevel[1])/winnerCount));
// filling winners vector
winners.push_back((*it)->getMyID());
}
}
// pot level sum not divisible by winnerCount
// --> distribution after smallBlind (perhaps lastActionPlayer? - TODO)
// --> distribution after smallBlind
else {
winnerPointer = currentHand->getDealerPosition();
@@ -215,8 +220,12 @@ void LocalBoard::distributePot() {
}
if(j<mod) {
(*it)->setMyCash( (*it)->getMyCash() + (int)((potLevel[1])/winnerCount) + 1);
// filling winners vector
winners.push_back((*it)->getMyID());
} else {
(*it)->setMyCash( (*it)->getMyCash() + (int)((potLevel[1])/winnerCount));
// filling winners vector
winners.push_back((*it)->getMyID());
}
}
}
@@ -241,6 +250,11 @@ void LocalBoard::distributePot() {
}
}
// winners sort and unique
winners.sort();
winners.unique();
// ERROR-Outputs
if(pot!=0) cout << "distributePot-ERROR: Pot = " << pot << endl;
+4
View File
@@ -50,6 +50,8 @@ public:
void collectPot() ;
void distributePot();
std::list<int> getWinners() const { return winners; }
private:
@@ -60,6 +62,8 @@ private:
HandInterface *currentHand;
std::list<int> winners;
int myCards[5];
int pot;
int sets;
+2 -2
View File
@@ -142,8 +142,8 @@ public:
bool getSBluffStatus() const { return sBluffStatus; }
void setMyWinnerState ( bool theValue, int pot ) {
myWinnerState = theValue;
if(theValue) actualHand->getGuiInterface()->logPlayerWinsMsg(myName, pot);
if(theValue) myWinnerState = theValue;
actualHand->getGuiInterface()->logPlayerWinsMsg(myName, pot, theValue);
}
bool getMyWinnerState() const { return myWinnerState;}