diff --git a/src/engine/local_engine/localhand.cpp b/src/engine/local_engine/localhand.cpp index 2cddebde..da932553 100755 --- a/src/engine/local_engine/localhand.cpp +++ b/src/engine/local_engine/localhand.cpp @@ -91,7 +91,7 @@ LocalHand::LocalHand(boost::shared_ptr f, GuiInterface *g, BoardI // myFlipCards auf 0 setzen for(i=0; isetMyCardsFlip(0); + playerArray[i]->setMyCardsFlip(0, 0); } // // // !!!!!!!!!!!!!!!!!!!!!!!!!!!!! testing !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // diff --git a/src/engine/local_engine/localplayer.h b/src/engine/local_engine/localplayer.h index e445fc16..e8253477 100755 --- a/src/engine/local_engine/localplayer.h +++ b/src/engine/local_engine/localplayer.h @@ -83,7 +83,21 @@ public: void setMyTurn(bool theValue){ myTurn = theValue;} bool getMyTurn() const{ return myTurn;} - void setMyCardsFlip(bool theValue){ myCardsFlip = theValue;} + void setMyCardsFlip(bool theValue, int state){ + myCardsFlip = theValue; + // log flipping cards + if(myCardsFlip) { + switch(state) { + case 1: actualHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt); + break; + case 2: actualHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1]); + break; + case 3: actualHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt, "has"); + break; + default: ; + } + } + } bool getMyCardsFlip() const{ return myCardsFlip;} void setMyCardsValueInt(int theValue) { myCardsValueInt = theValue;} @@ -118,6 +132,14 @@ public: void setSBluffStatus ( bool theValue ) { sBluffStatus = theValue; } bool getSBluffStatus() const { return sBluffStatus; } + void setMyWinnerState ( bool theValue, int pot ) { + myWinnerState = theValue; + if(theValue) actualHand->getGuiInterface()->logPlayerWinsMsg(myID, pot); + } + bool getMyWinnerState() const { return myWinnerState;} + + + void action(); void preflopEngine(); @@ -141,6 +163,8 @@ public: void setNetSessionData(boost::shared_ptr session); boost::shared_ptr getNetSessionData(); + + private: ConfigFile *myConfig; @@ -181,6 +205,8 @@ private: int sBluff; bool sBluffStatus; + + bool myWinnerState; boost::shared_ptr myNetSessionData; }; diff --git a/src/engine/network_engine/clienthand.cpp b/src/engine/network_engine/clienthand.cpp index eb078082..e145a6c5 100644 --- a/src/engine/network_engine/clienthand.cpp +++ b/src/engine/network_engine/clienthand.cpp @@ -34,7 +34,7 @@ ClientHand::ClientHand(boost::shared_ptr f, GuiInterface *g, Boar if(playerArray[i]->getMyActiveStatus() != 0) { playerArray[i]->setHand(this); } - playerArray[i]->setMyCardsFlip(0); + playerArray[i]->setMyCardsFlip(0, 0); } diff --git a/src/engine/network_engine/clientplayer.h b/src/engine/network_engine/clientplayer.h index f64e2a26..67cd3db3 100644 --- a/src/engine/network_engine/clientplayer.h +++ b/src/engine/network_engine/clientplayer.h @@ -77,7 +77,7 @@ public: void setMyTurn(bool theValue){ myTurn = theValue;} bool getMyTurn() const{ return myTurn;} - void setMyCardsFlip(bool theValue){ myCardsFlip = theValue;} + void setMyCardsFlip(bool theValue, int state){ myCardsFlip = theValue;} bool getMyCardsFlip() const{ return myCardsFlip;} void setMyCardsValueInt(int theValue) { myCardsValueInt = theValue;} @@ -112,6 +112,9 @@ public: void setSBluffStatus ( bool theValue ) { sBluffStatus = theValue; } bool getSBluffStatus() const { return sBluffStatus; } + void setMyWinnerState ( bool theValue, int pot ) { myWinnerState = theValue; } + bool getMyWinnerState() const { return myWinnerState;} + void action(); void preflopEngine(); @@ -176,6 +179,8 @@ private: int sBluff; bool sBluffStatus; + bool myWinnerState; + boost::shared_ptr myNetSessionData; }; diff --git a/src/engine/playerinterface.h b/src/engine/playerinterface.h index 84368e5a..9e460a5f 100644 --- a/src/engine/playerinterface.h +++ b/src/engine/playerinterface.h @@ -74,7 +74,7 @@ public: virtual void setMyTurn(bool theValue) =0; virtual bool getMyTurn() const =0; - virtual void setMyCardsFlip(bool theValue) =0; + virtual void setMyCardsFlip(bool theValue, int state) =0; virtual bool getMyCardsFlip() const =0; virtual void setMyCardsValueInt(int theValue) =0; @@ -96,6 +96,9 @@ public: virtual void setSBluffStatus ( bool theValue ) =0; virtual bool getSBluffStatus() const =0; + + virtual void setMyWinnerState ( bool theValue, int pot ) =0; + virtual bool getMyWinnerState() const =0; virtual void action() =0; diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 5f80e034..e72b747b 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -1846,10 +1846,8 @@ void mainWindowImpl::postRiverRunAnimation2() { holeCardsArray[i][j]->startFlipCards(guiGameSpeed, QPixmap(":/cards/resources/graphics/cards/"+QString::number(tempCardsIntArray[j], 10)+".png"), flipside); } } - //Karten umdrehen Loggen - myLog->logFlipHoleCardsMsg(currentHand->getPlayerArray()[i]->getMyName(), tempCardsIntArray[0], tempCardsIntArray[1], currentHand->getPlayerArray()[i]->getMyCardsValueInt()); - - currentHand->getPlayerArray()[i]->setMyCardsFlip(1); + //set Player value (logging) + currentHand->getPlayerArray()[i]->setMyCardsFlip(1,1); } } } @@ -1874,10 +1872,8 @@ void mainWindowImpl::postRiverRunAnimation2() { } } - //Karten umdrehen Loggen - myLog->logFlipHoleCardsMsg(currentHand->getPlayerArray()[i]->getMyName(), tempCardsIntArray[0], tempCardsIntArray[1], currentHand->getPlayerArray()[i]->getMyCardsValueInt() ); - - currentHand->getPlayerArray()[i]->setMyCardsFlip(1); + //set Player value (logging) + currentHand->getPlayerArray()[i]->setMyCardsFlip(1,1); } } } @@ -1891,8 +1887,8 @@ void mainWindowImpl::postRiverRunAnimation2() { currentHand->getPlayerArray()[i]->getMyCards(tempCardsIntArray); if(currentHand->getPlayerArray()[i]->getMyActiveStatus() && currentHand->getPlayerArray()[i]->getMyAction() != 1) { - //Kartenwerte Loggen - myLog->logFlipHoleCardsMsg(currentHand->getPlayerArray()[i]->getMyName(), tempCardsIntArray[0], tempCardsIntArray[1], currentHand->getPlayerArray()[i]->getMyCardsValueInt(), "has"); + //set Player value (logging) + currentHand->getPlayerArray()[i]->setMyCardsFlip(1,3); } } } @@ -1971,7 +1967,10 @@ void mainWindowImpl::postRiverRunAnimation3() { int pot = currentHand->getPlayerArray()[i]->getMyCash() - cashLabelArray[i]->text().remove(" $").toInt(&toIntBool,10) ; //Wenn River dann auch das Blatt loggen! // if (textLabel_handLabel->text() == "River") { - myLog->logPlayerWinsMsg(i, pot); + + //set Player value (logging) + currentHand->getPlayerArray()[i]->setMyWinnerState(1, pot); + // } // else { // myLog->logPlayerWinsMsg(i, pot); @@ -2109,10 +2108,8 @@ void mainWindowImpl::flipHolecardsAllIn() { holeCardsArray[i][j]->startFlipCards(guiGameSpeed, QPixmap(":/cards/resources/graphics/cards/"+QString::number(tempCardsIntArray[j], 10)+".png"), flipside); } } - //Karten umdrehen Loggen - myLog->logFlipHoleCardsMsg(currentHand->getPlayerArray()[i]->getMyName(), tempCardsIntArray[0], tempCardsIntArray[1]); - - currentHand->getPlayerArray()[i]->setMyCardsFlip(1); + //set Player value (logging) + currentHand->getPlayerArray()[i]->setMyCardsFlip(1,2); } } @@ -2138,10 +2135,8 @@ void mainWindowImpl::flipHolecardsAllIn() { holeCardsArray[i][j]->setPixmap(tempCardsPixmapArray[j], FALSE); } } - //Karten umdrehen Loggen - myLog->logFlipHoleCardsMsg(currentHand->getPlayerArray()[i]->getMyName(), temp2CardsIntArray[0], temp2CardsIntArray[1] ); - - currentHand->getPlayerArray()[i]->setMyCardsFlip(1); + //set Player value (logging) + currentHand->getPlayerArray()[i]->setMyCardsFlip(1,2); } } } @@ -2160,10 +2155,9 @@ void mainWindowImpl::showMyCards() { currentHand->getPlayerArray()[0]->getMyCards(tempCardsIntArray); if( currentHand->getPlayerArray()[0]->getMyCardsFlip() == 0 && currentHand->getActualRound() == 4 && currentHand->getPlayerArray()[0]->getMyActiveStatus() && currentHand->getPlayerArray()[0]->getMyAction() != 1) { - //Karten umdrehen Loggen - myLog->logFlipHoleCardsMsg(currentHand->getPlayerArray()[0]->getMyName().c_str(), tempCardsIntArray[0], tempCardsIntArray[1], currentHand->getPlayerArray()[0]->getMyCardsValueInt() ); - currentHand->getPlayerArray()[0]->setMyCardsFlip(1); + //set Player value (logging) + currentHand->getPlayerArray()[0]->setMyCardsFlip(1,1); } } @@ -2612,7 +2606,7 @@ void mainWindowImpl::playSound() { can free it up and set 'music' back to NULL. SDL_Mixer provides us with a callback routine we can use to do exactly that */ -// Mix_HookMusicFinished(mainWindowImpl::musicDone); +// Mix_HookMusicFinished(musicDone); }