- some changes in sqlite logging

- replace beroID-int by GameState in hand
This commit is contained in:
floty
2011-10-22 23:57:02 +00:00
parent a958c4916e
commit ad4aace71d
11 changed files with 54 additions and 97 deletions
+1 -1
View File
@@ -176,7 +176,7 @@ void LocalBeRo::run()
// aktuelle bero nicht dran, weil alle Sets gleich sind
//also gehe in naechste bero
myHand->setCurrentRound(myBeRoID+1);
myHand->setCurrentRound(GameState(myBeRoID+1));
//Action loeschen und ActionButtons refresh
for(it_c=myHand->getRunningPlayerList()->begin(); it_c!=myHand->getRunningPlayerList()->end(); ++it_c) {
+15 -1
View File
@@ -83,7 +83,7 @@ void LocalBeRoPostRiver::postRiverRun()
//Pot auf 0 setzen
getMyHand()->getBoard()->setPot(0);
// Logging hole Cards / Hands
// logging hole Cards / Hands
int nonfoldPlayersCounter = 0;
for (it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); ++it_c) {
if ((*it_c)->getMyAction() != PLAYER_ACTION_FOLD) nonfoldPlayersCounter++;
@@ -92,6 +92,20 @@ void LocalBeRoPostRiver::postRiverRun()
getMyHand()->getLog()->logHoleCardsHandName(5,getMyHand()->getActivePlayerList());
}
// logging winner if game is over
// wenn nur noch ein Spieler aktive "neues Spiel"-Dialog anzeigen
int playersPositiveCashCounter = 0;
for (it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); ++it_c) {
if ((*it_c)->getMyCash() > 0) playersPositiveCashCounter++;
}
if (playersPositiveCashCounter==1) {
for (it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); ++it_c) {
if ((*it_c)->getMyCash() > 0) {
getMyHand()->getLog()->logPlayerAction(5,(*it_c)->getMyID()+1,LOG_ACTION_WIN_GAME);
}
}
}
//starte die Animaionsreihe
getMyHand()->getGuiInterface()->postRiverRunAnimation1();
}
+8 -6
View File
@@ -30,7 +30,7 @@
using namespace std;
LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, unsigned dP, int sB,int sC)
: myFactory(f), myGui(g), myBoard(b), myLog(l), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myBeRo(0), myID(id), startQuantityPlayers(sP), dealerPosition(dP), smallBlindPosition(dP), bigBlindPosition(dP), currentRound(0), smallBlind(sB), startCash(sC), lastPlayersTurn(-1), lastActionPlayer(0), allInCondition(false),
: myFactory(f), myGui(g), myBoard(b), myLog(l), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myBeRo(0), myID(id), startQuantityPlayers(sP), dealerPosition(dP), smallBlindPosition(dP), bigBlindPosition(dP), currentRound(GAME_STATE_PREFLOP), smallBlind(sB), startCash(sC), lastPlayersTurn(-1), lastActionPlayer(0), allInCondition(false),
cardsShown(false), bettingRoundsPlayed(0)
{
@@ -566,7 +566,7 @@ void LocalHand::switchRounds()
myBoard->collectPot();
myGui->refreshPot();
myGui->refreshSet();
currentRound = 4;
currentRound = GAME_STATE_POST_RIVER;
}
// check for all in condition
@@ -627,13 +627,15 @@ void LocalHand::switchRounds()
myGui->refreshSet();
myGui->flipHolecardsAllIn();
// Logging HoleCards
myLog->logHoleCards(currentRound+1,activePlayerList);
if(currentRound<GAME_STATE_RIVER) {
myLog->logHoleCardsHandName(currentRound+1,activePlayerList);
}
if (currentRound < 4) // do not increment past 4
currentRound++;
if (currentRound < GAME_STATE_POST_RIVER) // do not increment past 4
currentRound = GameState(currentRound + 1);
//log board cards for allin
if(currentRound >= 1) {
if(currentRound >= GAME_STATE_FLOP) {
int tempBoardCardsArray[5];
myBoard->getMyCards(tempBoardCardsArray);
+3 -3
View File
@@ -88,10 +88,10 @@ public:
return startQuantityPlayers;
}
void setCurrentRound(int theValue) {
void setCurrentRound(GameState theValue) {
currentRound = theValue;
}
int getCurrentRound() const {
GameState getCurrentRound() const {
return currentRound;
}
@@ -177,7 +177,7 @@ private:
unsigned dealerPosition;
unsigned smallBlindPosition;
unsigned bigBlindPosition;
int currentRound; //0 = preflop, 1 = flop, 2 = turn, 3 = river
GameState currentRound;
int smallBlind;
int startCash;