sqlite-log: complete new hand log

This commit is contained in:
floty
2011-02-25 21:21:36 +00:00
parent 9264aa86eb
commit e17b5fa74e
7 changed files with 159 additions and 72 deletions
+1
View File
@@ -141,6 +141,7 @@ void LocalBeRo::run()
switch(myBeRoID) {
case GAME_STATE_FLOP:
myHand->getGuiInterface()->logDealBoardCardsMsg(myBeRoID, tempBoardCardsArray[0], tempBoardCardsArray[1], tempBoardCardsArray[2]);
myHand->getLog()->logBoardCards(myBeRoID, tempBoardCardsArray);
break;
case GAME_STATE_TURN:
myHand->getGuiInterface()->logDealBoardCardsMsg(myBeRoID, tempBoardCardsArray[0], tempBoardCardsArray[1], tempBoardCardsArray[2], tempBoardCardsArray[3]);
+34 -25
View File
@@ -357,10 +357,13 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost:
// ----------------------------------------
// determine dealer, SB, BB
assignButtons();
myLog->logNewHandMsg(myID, dealerPosition, smallBlind, smallBlindPosition, 2*smallBlind, bigBlindPosition, seatsList);
setBlinds();
myBeRo = myFactory->createBeRo(this, myID, dealerPosition, smallBlind);
}
@@ -467,40 +470,46 @@ void LocalHand::assignButtons()
}
// cout << "lAP-Button: " << lastActionPlayer << endl;
}
//do sets --> TODO switch?
for (it_c=runningPlayerList->begin(); it_c!=runningPlayerList->end(); ++it_c) {
void LocalHand::setBlinds()
{
//small blind
if((*it_c)->getMyButton() == BUTTON_SMALL_BLIND) {
PlayerListConstIterator it_c;
// All in ?
if((*it_c)->getMyCash() <= smallBlind) {
//do sets --> TODO switch?
for (it_c=runningPlayerList->begin(); it_c!=runningPlayerList->end(); ++it_c) {
(*it_c)->setMySet((*it_c)->getMyCash());
// 1 to do not log this
(*it_c)->setMyAction(PLAYER_ACTION_ALLIN,1);
//small blind
if((*it_c)->getMyButton() == BUTTON_SMALL_BLIND) {
} else {
(*it_c)->setMySet(smallBlind);
}
}
// All in ?
if((*it_c)->getMyCash() <= smallBlind) {
//big blind
if((*it_c)->getMyButton() == BUTTON_BIG_BLIND) {
(*it_c)->setMySet((*it_c)->getMyCash());
// 1 to do not log this
(*it_c)->setMyAction(PLAYER_ACTION_ALLIN,1);
// all in ?
if((*it_c)->getMyCash() <= 2*smallBlind) {
} else {
(*it_c)->setMySet(smallBlind);
}
}
(*it_c)->setMySet((*it_c)->getMyCash());
// 1 to do not log this
(*it_c)->setMyAction(PLAYER_ACTION_ALLIN,1);
//big blind
if((*it_c)->getMyButton() == BUTTON_BIG_BLIND) {
} else {
(*it_c)->setMySet(2*smallBlind);
}
}
}
// all in ?
if((*it_c)->getMyCash() <= 2*smallBlind) {
(*it_c)->setMySet((*it_c)->getMyCash());
// 1 to do not log this
(*it_c)->setMyAction(PLAYER_ACTION_ALLIN,1);
} else {
(*it_c)->setMySet(2*smallBlind);
}
}
}
}
+5
View File
@@ -71,6 +71,10 @@ public:
return myBeRo[currentRound];
}
Log* getLog() const {
return myLog;
}
void setMyID(int theValue) {
myID = theValue;
}
@@ -147,6 +151,7 @@ public:
}
void assignButtons();
void setBlinds();
void switchRounds();