From bb3fb9e13c1fef63008a7a93553832d8998218a3 Mon Sep 17 00:00:00 2001 From: floty Date: Sat, 29 Oct 2011 14:41:17 +0000 Subject: [PATCH] delete unused function "getMyWinnerState"; activate Engine-Action-Log in localHand; run astyle --- src/engine/local_engine/localhand.cpp | 57 +++++++++++----------- src/engine/local_engine/localplayer.h | 5 -- src/engine/network_engine/clientplayer.cpp | 7 --- src/engine/network_engine/clientplayer.h | 1 - src/engine/playerinterface.h | 1 - src/gui/qt/gametable/gametableimpl.cpp | 8 --- src/gui/qt/startwindow/startwindowimpl.cpp | 3 +- 7 files changed, 31 insertions(+), 51 deletions(-) diff --git a/src/engine/local_engine/localhand.cpp b/src/engine/local_engine/localhand.cpp index 7e12ced7..d38ed3e4 100755 --- a/src/engine/local_engine/localhand.cpp +++ b/src/engine/local_engine/localhand.cpp @@ -528,34 +528,35 @@ void LocalHand::setBlinds() void LocalHand::switchRounds() { -// // logging last player action -// PlayerListConstIterator previousPlayerIt = getRunningPlayerIt(previousPlayerID); -// if(previousPlayerIt == runningPlayerList->end()) { -// throw LocalException(__FILE__, __LINE__, ERR_RUNNING_PLAYER_NOT_FOUND); -// } - - -// switch((*previousPlayerIt)->getMyAction()) { -// case PLAYER_ACTION_FOLD: { -// myLog->logPlayerAction(currentRound+1,(*previousPlayerIt)->getMyID()+1,LOG_ACTION_FOLD); -// } break; -// case PLAYER_ACTION_CHECK: { -// myLog->logPlayerAction(currentRound+1,(*previousPlayerIt)->getMyID()+1,LOG_ACTION_CHECK); -// } break; -// case PLAYER_ACTION_CALL: { -// myLog->logPlayerAction(currentRound+1,(*previousPlayerIt)->getMyID()+1,LOG_ACTION_CALL); -// } break; -// case PLAYER_ACTION_BET: -// case PLAYER_ACTION_RAISE: { -// myLog->logPlayerAction(currentRound+1,(*previousPlayerIt)->getMyID()+1,LOG_ACTION_BET,(*previousPlayerIt)->getMySet()); -// } break; -// case PLAYER_ACTION_ALLIN: { -// myLog->logPlayerAction(currentRound+1,(*previousPlayerIt)->getMyID()+1,LOG_ACTION_ALL_IN,(*previousPlayerIt)->getMySet()); -// } break; -// default: { -// } -// } - + // logging last player action + PlayerListConstIterator previousPlayerIt = getRunningPlayerIt(previousPlayerID); + if(previousPlayerIt != runningPlayerList->end()) { + switch((*previousPlayerIt)->getMyAction()) { + case PLAYER_ACTION_FOLD: { + myLog->logPlayerAction(currentRound+1,(*previousPlayerIt)->getMyID()+1,LOG_ACTION_FOLD); + } + break; + case PLAYER_ACTION_CHECK: { + myLog->logPlayerAction(currentRound+1,(*previousPlayerIt)->getMyID()+1,LOG_ACTION_CHECK); + } + break; + case PLAYER_ACTION_CALL: { + myLog->logPlayerAction(currentRound+1,(*previousPlayerIt)->getMyID()+1,LOG_ACTION_CALL,(*previousPlayerIt)->getMySet()); + } + break; + case PLAYER_ACTION_BET: + case PLAYER_ACTION_RAISE: { + myLog->logPlayerAction(currentRound+1,(*previousPlayerIt)->getMyID()+1,LOG_ACTION_BET,(*previousPlayerIt)->getMySet()); + } + break; + case PLAYER_ACTION_ALLIN: { + myLog->logPlayerAction(currentRound+1,(*previousPlayerIt)->getMyID()+1,LOG_ACTION_ALL_IN,(*previousPlayerIt)->getMySet()); + } + break; + default: { + } + } + } PlayerListIterator it, it_1; PlayerListConstIterator it_c; diff --git a/src/engine/local_engine/localplayer.h b/src/engine/local_engine/localplayer.h index d9191ae4..857370df 100755 --- a/src/engine/local_engine/localplayer.h +++ b/src/engine/local_engine/localplayer.h @@ -255,11 +255,6 @@ public: if(theValue) myWinnerState = theValue; currentHand->getGuiInterface()->logPlayerWinsMsg(myName, pot, theValue); } - bool getMyWinnerState() const { - return myWinnerState; - } - - void action(); diff --git a/src/engine/network_engine/clientplayer.cpp b/src/engine/network_engine/clientplayer.cpp index 809936ca..8fb795be 100644 --- a/src/engine/network_engine/clientplayer.cpp +++ b/src/engine/network_engine/clientplayer.cpp @@ -442,13 +442,6 @@ ClientPlayer::setMyWinnerState(bool theValue, int pot) currentHand->getGuiInterface()->logPlayerWinsMsg(myName, pot, theValue); } -bool -ClientPlayer::getMyWinnerState() const -{ - boost::recursive_mutex::scoped_lock lock(m_syncMutex); - return myWinnerState; -} - void ClientPlayer::action() { diff --git a/src/engine/network_engine/clientplayer.h b/src/engine/network_engine/clientplayer.h index cd8812d7..bbe602c3 100644 --- a/src/engine/network_engine/clientplayer.h +++ b/src/engine/network_engine/clientplayer.h @@ -110,7 +110,6 @@ public: bool getSBluffStatus() const; void setMyWinnerState (bool theValue, int pot); - bool getMyWinnerState() const; void action(); int checkMyAction(int targetAction, int targetBet, int highestSet, int minimumRaise, int smallBlind); diff --git a/src/engine/playerinterface.h b/src/engine/playerinterface.h index 81e7313c..0b7276b1 100644 --- a/src/engine/playerinterface.h +++ b/src/engine/playerinterface.h @@ -108,7 +108,6 @@ public: virtual bool getSBluffStatus() const =0; virtual void setMyWinnerState ( bool theValue, int pot ) =0; - virtual bool getMyWinnerState() const =0; virtual void action() =0; virtual int checkMyAction(int targetAction, int targetBet, int highestSet, int minimumRaise, int smallBlind) = 0; diff --git a/src/gui/qt/gametable/gametableimpl.cpp b/src/gui/qt/gametable/gametableimpl.cpp index 05095b53..a0f3da72 100755 --- a/src/gui/qt/gametable/gametableimpl.cpp +++ b/src/gui/qt/gametable/gametableimpl.cpp @@ -1824,7 +1824,6 @@ void gameTableImpl::myFold() boost::shared_ptr currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand(); boost::shared_ptr humanPlayer = currentHand->getSeatsList()->front(); humanPlayer->setMyAction(PLAYER_ACTION_FOLD); -// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_FOLD); humanPlayer->setMyTurn(0); //set that i was the last active player. need this for unhighlighting groupbox @@ -1843,7 +1842,6 @@ void gameTableImpl::myCheck() boost::shared_ptr currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand(); boost::shared_ptr humanPlayer = currentHand->getSeatsList()->front(); humanPlayer->setMyTurn(0); -// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_CHECK); humanPlayer->setMyAction(PLAYER_ACTION_CHECK); //set that i was the last active player. need this for unhighlighting groupbox @@ -1910,11 +1908,9 @@ void gameTableImpl::myCall() humanPlayer->setMySet(humanPlayer->getMyCash()); humanPlayer->setMyCash(0); -// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_ALL_IN,humanPlayer->getMySet()); humanPlayer->setMyAction(PLAYER_ACTION_ALLIN); } else { humanPlayer->setMySet(tempHighestSet - humanPlayer->getMySet()); -// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_CALL,humanPlayer->getMySet()); humanPlayer->setMyAction(PLAYER_ACTION_CALL); } humanPlayer->setMyTurn(0); @@ -1949,7 +1945,6 @@ void gameTableImpl::mySet() humanPlayer->setMySet(humanPlayer->getMyCash()); humanPlayer->setMyCash(0); humanPlayer->setMyAction(PLAYER_ACTION_ALLIN); -// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_ALL_IN,humanPlayer->getMySet()); // full bet rule if(currentHand->getCurrentBeRo()->getHighestSet() + currentHand->getCurrentBeRo()->getMinimumRaise() > humanPlayer->getMySet()) { @@ -1961,7 +1956,6 @@ void gameTableImpl::mySet() //do not if allIn if(humanPlayer->getMyAction() != 6) { humanPlayer->setMyAction(PLAYER_ACTION_RAISE); -// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_BET,humanPlayer->getMySet()); } myActionIsRaise = 0; @@ -1972,7 +1966,6 @@ void gameTableImpl::mySet() //do not if allIn if(humanPlayer->getMyAction() != 6) { humanPlayer->setMyAction(PLAYER_ACTION_BET); -// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_BET,humanPlayer->getMySet()); } myActionIsBet = 0; @@ -2010,7 +2003,6 @@ void gameTableImpl::myAllIn() humanPlayer->setMySet(humanPlayer->getMyCash()); humanPlayer->setMyCash(0); humanPlayer->setMyAction(PLAYER_ACTION_ALLIN); -// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_ALL_IN,humanPlayer->getMySet()); // full bet rule if(currentHand->getCurrentBeRo()->getHighestSet() + currentHand->getCurrentBeRo()->getMinimumRaise() > humanPlayer->getMySet()) { diff --git a/src/gui/qt/startwindow/startwindowimpl.cpp b/src/gui/qt/startwindow/startwindowimpl.cpp index ba1865ff..d1cc4695 100644 --- a/src/gui/qt/startwindow/startwindowimpl.cpp +++ b/src/gui/qt/startwindow/startwindowimpl.cpp @@ -371,7 +371,8 @@ void startWindowImpl::callInternetGameLoginDialog() void startWindowImpl::callRejoinPossibleDialog(unsigned gameId) -{/* +{ + /* assert(mySession); GameInfo info(mySession->getClientGameInfo(gameId));*/