diff --git a/src/game.cpp b/src/game.cpp index e10bd534..35f543a1 100755 --- a/src/game.cpp +++ b/src/game.cpp @@ -31,7 +31,7 @@ using namespace std; -Game::Game(ConfigFile* c, GuiInterface* g, int qP, int sC, int sB) : myConfig(c), myGui(g), actualHand(0), actualBoard(0), startQuantityPlayers(qP), startCash(sC), startSmallBlind(sB), actualQuantityPlayers(qP), actualSmallBlind(sB), actualHandID(0), dealerPosition(0) +Game::Game(ConfigFile* c, GuiInterface* g, int qP, int sC, int sB, int gId) : myConfig(c), myGui(g), actualHand(0), actualBoard(0), startQuantityPlayers(qP), startCash(sC), startSmallBlind(sB), myGameID(gId), actualQuantityPlayers(qP), actualSmallBlind(sB), actualHandID(0), dealerPosition(0) { // cout << "Create Game Object" << "\n"; int i; @@ -142,5 +142,8 @@ void Game::startHand() } while(!(playerArray[dealerPosition]->getMyActiveStatus())); + myGui->logNewGameHandMsg(myGameID, actualHandID); + + // Abfrage Cash==0 -> player inactive -> actualQuantityPlayer-- } diff --git a/src/game.h b/src/game.h index 4b32ac3f..fe8e0add 100755 --- a/src/game.h +++ b/src/game.h @@ -35,7 +35,7 @@ class ConfigFile; class Game { public: - Game(ConfigFile*, GuiInterface*, int, int, int); + Game(ConfigFile*, GuiInterface*, int, int, int, int); ~Game(); @@ -52,6 +52,10 @@ public: void setDealerPosition(const int& theValue) { dealerPosition = theValue; } int getDealerPosition() const { return dealerPosition; } + void setMyGameID(const int& theValue) { myGameID = theValue;} + int getMyGameID() const { return myGameID; } + + //Zufgriff Laufvariablen void setActualQuantityPlayers(const int& theValue) { actualQuantityPlayers = theValue; } @@ -83,11 +87,11 @@ private: BoardInterface *actualBoard; PlayerInterface *playerArray[5]; - //Startvariablen int startQuantityPlayers; int startCash; int startSmallBlind; + int myGameID; //Laufvariablen int actualQuantityPlayers; diff --git a/src/gui/guiinterface.h b/src/gui/guiinterface.h index 10e8585e..c5759175 100644 --- a/src/gui/guiinterface.h +++ b/src/gui/guiinterface.h @@ -92,7 +92,8 @@ public: //log.cpp - virtual void logPlayerActionMsg(std::string playName, int action, int setValue) const=0; + virtual void logPlayerActionMsg(std::string playName, int action, int setValue) =0; + virtual void logNewGameHandMsg(int gameID, int HandID) =0; diff --git a/src/gui/qt/guiwrapper.cpp b/src/gui/qt/guiwrapper.cpp index 000c1f82..63151ef4 100644 --- a/src/gui/qt/guiwrapper.cpp +++ b/src/gui/qt/guiwrapper.cpp @@ -86,7 +86,7 @@ void GuiWrapper::nextRoundCleanGui() const { myW->nextRoundCleanGui(); } void GuiWrapper::meInAction() const { myW->meInAction(); } -void GuiWrapper::logPlayerActionMsg(string playerName, int action, int setValue) const { myLog->logPlayerActionMsg(playerName, action, setValue); } - +void GuiWrapper::logPlayerActionMsg(string playerName, int action, int setValue) { myLog->logPlayerActionMsg(playerName, action, setValue); } +void GuiWrapper::logNewGameHandMsg(int gameID, int handID) { myLog->logNewGameHandMsg(gameID, handID); } diff --git a/src/gui/qt/guiwrapper.h b/src/gui/qt/guiwrapper.h index c6fbbdf1..99b1ad6f 100644 --- a/src/gui/qt/guiwrapper.h +++ b/src/gui/qt/guiwrapper.h @@ -83,7 +83,8 @@ public: void meInAction() const; - void logPlayerActionMsg(std::string playerName, int action, int setValue) const; + void logPlayerActionMsg(std::string playerName, int action, int setValue) ; + void logNewGameHandMsg(int gameID, int handID) ; private: diff --git a/src/gui/qt/log.cpp b/src/gui/qt/log.cpp index 9b6bf696..b6e721d2 100644 --- a/src/gui/qt/log.cpp +++ b/src/gui/qt/log.cpp @@ -38,18 +38,16 @@ Log::Log(mainWindowImpl* w) : myW(w) myLogFile->open( QIODevice::WriteOnly ); QTextStream stream( myLogFile ); - stream << ""; - stream << "
"; - stream << "
";
- stream << "
\n";
+ stream << "