- rename lastPlayersTurn -> previousPlayerID and lastActionPlayer -> lastActionPlayerID

This commit is contained in:
floty
2011-10-26 19:34:57 +00:00
parent c867a789d3
commit f1dc2e90a5
15 changed files with 119 additions and 116 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ public:
virtual void setSets(int theValue) =0; virtual void setSets(int theValue) =0;
virtual void setAllInCondition(bool theValue) =0; virtual void setAllInCondition(bool theValue) =0;
virtual void setLastActionPlayer(unsigned theValue) =0; virtual void setLastActionPlayerID(unsigned theValue) =0;
// //
virtual void collectSets() =0; virtual void collectSets() =0;
virtual void collectPot() =0; virtual void collectPot() =0;
+4 -4
View File
@@ -70,11 +70,11 @@ public:
virtual void setBettingRoundsPlayed(int theValue) =0; virtual void setBettingRoundsPlayed(int theValue) =0;
virtual int getBettingRoundsPlayed() const =0; virtual int getBettingRoundsPlayed() const =0;
virtual void setLastPlayersTurn(int theValue) =0; virtual void setPreviousPlayerID(int theValue) =0;
virtual int getLastPlayersTurn() const =0; virtual int getPreviousPlayerID() const =0;
virtual void setLastActionPlayer( unsigned theValue ) =0; virtual void setLastActionPlayerID( unsigned theValue ) =0;
virtual unsigned getLastActionPlayer() const =0; virtual unsigned getLastActionPlayerID() const =0;
virtual void setCardsShown(bool theValue) =0; virtual void setCardsShown(bool theValue) =0;
virtual bool getCardsShown() const =0; virtual bool getCardsShown() const =0;
+1 -27
View File
@@ -84,7 +84,7 @@ void LocalBeRo::run()
if(firstRunGui) { if(firstRunGui) {
firstRunGui = false; firstRunGui = false;
myHand->setLastPlayersTurn(-1); myHand->setPreviousPlayerID(-1);
myHand->getGuiInterface()->dealBeRoCards(myBeRoID); myHand->getGuiInterface()->dealBeRoCards(myBeRoID);
} else { } else {
@@ -243,32 +243,6 @@ void LocalBeRo::run()
myHand->getGuiInterface()->beRoAnimation2(myBeRoID); myHand->getGuiInterface()->beRoAnimation2(myBeRoID);
} }
// logging action
PlayerActionLog myActionLog = LOG_ACTION_NONE;
switch((*currentPlayersTurnIt)->getMyAction()) {
case PLAYER_ACTION_FOLD: {
myActionLog = LOG_ACTION_FOLD;
} break;
case PLAYER_ACTION_CHECK: {
myActionLog = LOG_ACTION_CHECK;
} break;
case PLAYER_ACTION_CALL: {
myActionLog = LOG_ACTION_CALL;
} break;
case PLAYER_ACTION_BET:
case PLAYER_ACTION_RAISE: {
myActionLog = LOG_ACTION_BET;
} break;
case PLAYER_ACTION_ALLIN: {
myActionLog = LOG_ACTION_ALL_IN;
} break;
default: {
}
}
if(myActionLog) {
// myHand->getLog()->logPlayerAction(myBeRoID+1,(*currentPlayersTurnIt)->getMyID()+1,myActionLog);
}
} }
} }
} }
+2 -2
View File
@@ -24,7 +24,7 @@
#include "localexception.h" #include "localexception.h"
#include "engine_msg.h" #include "engine_msg.h"
LocalBoard::LocalBoard(unsigned dp) : BoardInterface(), pot(0), sets(0), dealerPosition(dp), allInCondition(false), lastActionPlayer(0) LocalBoard::LocalBoard(unsigned dp) : BoardInterface(), pot(0), sets(0), dealerPosition(dp), allInCondition(false), lastActionPlayerID(0)
{ {
myCards[0] = myCards[1] = myCards[2] = myCards[3] = myCards[4] = 0; myCards[0] = myCards[1] = myCards[2] = myCards[3] = myCards[4] = 0;
} }
@@ -299,7 +299,7 @@ void LocalBoard::determinePlayerNeedToShowCards()
// cout << "lAP-Ende: " << currentHand->getLastActionPlayer() << endl; // cout << "lAP-Ende: " << currentHand->getLastActionPlayer() << endl;
// search lastActionPlayer // search lastActionPlayer
for(it_c = activePlayerList->begin(); it_c != activePlayerList->end(); ++it_c) { for(it_c = activePlayerList->begin(); it_c != activePlayerList->end(); ++it_c) {
if((*it_c)->getMyUniqueID() == lastActionPlayer && (*it_c)->getMyAction() != PLAYER_ACTION_FOLD) { if((*it_c)->getMyUniqueID() == lastActionPlayerID && (*it_c)->getMyAction() != PLAYER_ACTION_FOLD) {
lastActionPlayerIt = it_c; lastActionPlayerIt = it_c;
// cout << (*it_c)->getMyUniqueID() << endl; // cout << (*it_c)->getMyUniqueID() << endl;
break; break;
+3 -3
View File
@@ -49,8 +49,8 @@ public:
void setAllInCondition(bool theValue) { void setAllInCondition(bool theValue) {
allInCondition = theValue; allInCondition = theValue;
} }
void setLastActionPlayer(unsigned theValue) { void setLastActionPlayerID(unsigned theValue) {
lastActionPlayer = theValue; lastActionPlayerID = theValue;
} }
int getPot() const { int getPot() const {
@@ -100,7 +100,7 @@ private:
int sets; int sets;
unsigned dealerPosition; unsigned dealerPosition;
bool allInCondition; bool allInCondition;
unsigned lastActionPlayer; unsigned lastActionPlayerID;
}; };
+37 -8
View File
@@ -30,7 +30,7 @@
using namespace std; 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) 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(GAME_STATE_PREFLOP), 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), previousPlayerID(-1), lastActionPlayerID(0), allInCondition(false),
cardsShown(false), bettingRoundsPlayed(0) cardsShown(false), bettingRoundsPlayed(0)
{ {
@@ -448,8 +448,8 @@ void LocalHand::assignButtons()
} }
// first player after dealer have to show his cards first (in showdown) // first player after dealer have to show his cards first (in showdown)
lastActionPlayer = (*it)->getMyUniqueID(); lastActionPlayerID = (*it)->getMyUniqueID();
myBoard->setLastActionPlayer(lastActionPlayer); myBoard->setLastActionPlayerID(lastActionPlayerID);
++it; ++it;
if(it == activePlayerList->end()) it = activePlayerList->begin(); if(it == activePlayerList->end()) it = activePlayerList->begin();
@@ -528,6 +528,35 @@ void LocalHand::setBlinds()
void LocalHand::switchRounds() void LocalHand::switchRounds()
{ {
// logging last player action
// currentPlayersTurnIt = myHand->getRunningPlayerIt( currentPlayersTurnId );
// if(currentPlayersTurnIt == myHand->getRunningPlayerList()->end()) {
// throw LocalException(__FILE__, __LINE__, ERR_RUNNING_PLAYER_NOT_FOUND);
// }
// switch((*currentPlayersTurnIt)->getMyAction()) {
// case PLAYER_ACTION_FOLD: {
// myHand->getLog()->logPlayerAction(myBeRoID+1,(*currentPlayersTurnIt)->getMyID()+1,LOG_ACTION_FOLD);
// } break;
// case PLAYER_ACTION_CHECK: {
// myHand->getLog()->logPlayerAction(myBeRoID+1,(*currentPlayersTurnIt)->getMyID()+1,LOG_ACTION_CHECK);
// } break;
// case PLAYER_ACTION_CALL: {
// myHand->getLog()->logPlayerAction(myBeRoID+1,(*currentPlayersTurnIt)->getMyID()+1,LOG_ACTION_CALL);
// } break;
// case PLAYER_ACTION_BET:
// case PLAYER_ACTION_RAISE: {
// myHand->getLog()->logPlayerAction(myBeRoID+1,(*currentPlayersTurnIt)->getMyID()+1,LOG_ACTION_BET,(*currentPlayersTurnIt)->getMySet());
// } break;
// case PLAYER_ACTION_ALLIN: {
// myHand->getLog()->logPlayerAction(myBeRoID+1,(*currentPlayersTurnIt)->getMyID()+1,LOG_ACTION_ALL_IN,(*currentPlayersTurnIt)->getMySet());
// } break;
// default: {
// }
// }
PlayerListIterator it, it_1; PlayerListIterator it, it_1;
PlayerListConstIterator it_c; PlayerListConstIterator it_c;
@@ -646,10 +675,10 @@ void LocalHand::switchRounds()
} }
//unhighlight current players groupbox //unhighlight current players groupbox
it_c = getActivePlayerIt(lastPlayersTurn); it_c = getActivePlayerIt(previousPlayerID);
if( it_c != activePlayerList->end() ) { if( it_c != activePlayerList->end() ) {
// lastPlayersTurn is active // lastPlayersTurn is active
myGui->refreshGroupbox(lastPlayersTurn,1); myGui->refreshGroupbox(previousPlayerID,1);
} }
myGui->refreshGameLabels((GameState)getCurrentRound()); myGui->refreshGameLabels((GameState)getCurrentRound());
@@ -738,8 +767,8 @@ PlayerListIterator LocalHand::getRunningPlayerIt(unsigned uniqueId) const
} }
void LocalHand::setLastActionPlayer(unsigned theValue) void LocalHand::setLastActionPlayerID(unsigned theValue)
{ {
lastActionPlayer = theValue; lastActionPlayerID = theValue;
myBoard->setLastActionPlayer(theValue); myBoard->setLastActionPlayerID(theValue);
} }
+9 -9
View File
@@ -130,16 +130,16 @@ public:
return bettingRoundsPlayed; return bettingRoundsPlayed;
} }
void setLastPlayersTurn(int theValue) { void setPreviousPlayerID(int theValue) {
lastPlayersTurn = theValue; previousPlayerID = theValue;
} }
int getLastPlayersTurn() const { int getPreviousPlayerID() const {
return lastPlayersTurn; return previousPlayerID;
} }
void setLastActionPlayer ( unsigned theValue ); void setLastActionPlayerID ( unsigned theValue );
unsigned getLastActionPlayer() const { unsigned getLastActionPlayerID() const {
return lastActionPlayer; return lastActionPlayerID;
} }
void setCardsShown(bool theValue) { void setCardsShown(bool theValue) {
@@ -181,8 +181,8 @@ private:
int smallBlind; int smallBlind;
int startCash; int startCash;
int lastPlayersTurn; int previousPlayerID;
unsigned lastActionPlayer; unsigned lastActionPlayerID;
bool allInCondition; bool allInCondition;
bool cardsShown; bool cardsShown;
+16 -16
View File
@@ -1066,7 +1066,7 @@ void LocalPlayer::action()
// cout << "jetzt" << endl; // cout << "jetzt" << endl;
//set that i was the last active player. need this for unhighlighting groupbox //set that i was the last active player. need this for unhighlighting groupbox
currentHand->setLastPlayersTurn(myID); currentHand->setPreviousPlayerID(myID);
currentHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet); currentHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet);
currentHand->getGuiInterface()->nextPlayerAnimation(); currentHand->getGuiInterface()->nextPlayerAnimation();
@@ -3222,12 +3222,12 @@ void LocalPlayer::evaluation(int bet, int raise)
break; break;
// fold // fold
case 1: { case 1: {
currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_FOLD); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_FOLD);
} }
break; break;
// check // check
case 2: { case 2: {
currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_CHECK); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_CHECK);
} }
break; break;
// call // call
@@ -3238,14 +3238,14 @@ void LocalPlayer::evaluation(int bet, int raise)
mySet += myCash; mySet += myCash;
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet);
// cout << "evaluation(call) - mySet: " << mySet << endl; // cout << "evaluation(call) - mySet: " << mySet << endl;
} }
// sonst // sonst
else { else {
myCash = myCash - highestSet + mySet; myCash = myCash - highestSet + mySet;
mySet = highestSet; mySet = highestSet;
currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_CALL,mySet); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_CALL,mySet);
} }
} }
break; break;
@@ -3262,7 +3262,7 @@ void LocalPlayer::evaluation(int bet, int raise)
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
highestSet = mySet; highestSet = mySet;
currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet);
} }
// sonst // sonst
else { else {
@@ -3270,11 +3270,11 @@ void LocalPlayer::evaluation(int bet, int raise)
myCash = myCash - bet; myCash = myCash - bet;
mySet = bet; mySet = bet;
highestSet = mySet; highestSet = mySet;
currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_BET,mySet); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_BET,mySet);
} }
// lastPlayerAction für Karten umblättern reihenfolge setzrn // lastPlayerAction für Karten umblättern reihenfolge setzrn
currentHand->setLastActionPlayer(myUniqueID); currentHand->setLastActionPlayerID(myUniqueID);
} }
break; break;
// raise // raise
@@ -3285,14 +3285,14 @@ void LocalPlayer::evaluation(int bet, int raise)
mySet += myCash; mySet += myCash;
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet);
} }
// sonst // sonst
else { else {
myCash = myCash - highestSet + mySet; myCash = myCash - highestSet + mySet;
mySet = highestSet; mySet = highestSet;
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_CALL,mySet); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_CALL,mySet);
} }
} else { } else {
if(raise < currentHand->getCurrentBeRo()->getMinimumRaise()) { if(raise < currentHand->getCurrentBeRo()->getMinimumRaise()) {
@@ -3311,7 +3311,7 @@ void LocalPlayer::evaluation(int bet, int raise)
// raise, but not enough --> full bet rule // raise, but not enough --> full bet rule
currentHand->getCurrentBeRo()->setFullBetRule(true); currentHand->getCurrentBeRo()->setFullBetRule(true);
// lastPlayerAction für Karten umblättern reihenfolge setzrn // lastPlayerAction für Karten umblättern reihenfolge setzrn
currentHand->setLastActionPlayer(myUniqueID); currentHand->setLastActionPlayerID(myUniqueID);
mySet += myCash; mySet += myCash;
currentHand->getCurrentBeRo()->setMinimumRaise(mySet-highestSet); currentHand->getCurrentBeRo()->setMinimumRaise(mySet-highestSet);
@@ -3321,7 +3321,7 @@ void LocalPlayer::evaluation(int bet, int raise)
} }
} else { } else {
// lastPlayerAction für Karten umblättern reihenfolge setzrn // lastPlayerAction für Karten umblättern reihenfolge setzrn
currentHand->setLastActionPlayer(myUniqueID); currentHand->setLastActionPlayerID(myUniqueID);
mySet += myCash; mySet += myCash;
currentHand->getCurrentBeRo()->setMinimumRaise(mySet-highestSet); currentHand->getCurrentBeRo()->setMinimumRaise(mySet-highestSet);
@@ -3329,7 +3329,7 @@ void LocalPlayer::evaluation(int bet, int raise)
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
highestSet = mySet; highestSet = mySet;
} }
currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet);
} }
// sonst // sonst
else { else {
@@ -3338,15 +3338,15 @@ void LocalPlayer::evaluation(int bet, int raise)
mySet = highestSet + raise; mySet = highestSet + raise;
highestSet = mySet; highestSet = mySet;
// lastPlayerAction für Karten umblättern reihenfolge setzrn // lastPlayerAction für Karten umblättern reihenfolge setzrn
currentHand->setLastActionPlayer(myUniqueID); currentHand->setLastActionPlayerID(myUniqueID);
currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_BET,mySet); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_BET,mySet);
} }
} }
} }
break; break;
// all in // all in
case 6: { case 6: {
currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet);
} }
break; break;
default: default:
+3 -3
View File
@@ -24,7 +24,7 @@
using namespace std; using namespace std;
ClientBoard::ClientBoard(unsigned dp) ClientBoard::ClientBoard(unsigned dp)
: pot(0), sets(0), dealerPosition(dp), allInCondition(false), lastActionPlayer(0) : pot(0), sets(0), dealerPosition(dp), allInCondition(false), lastActionPlayerID(0)
{ {
myCards[0] = myCards[1] = myCards[2] = myCards[3] = myCards[4] = 0; myCards[0] = myCards[1] = myCards[2] = myCards[3] = myCards[4] = 0;
} }
@@ -95,10 +95,10 @@ ClientBoard::setAllInCondition(bool theValue)
} }
void void
ClientBoard::setLastActionPlayer(unsigned theValue) ClientBoard::setLastActionPlayerID(unsigned theValue)
{ {
boost::recursive_mutex::scoped_lock lock(m_syncMutex); boost::recursive_mutex::scoped_lock lock(m_syncMutex);
lastActionPlayer = theValue; lastActionPlayerID = theValue;
} }
void void
+2 -2
View File
@@ -45,7 +45,7 @@ public:
void setSets(int theValue); void setSets(int theValue);
void setAllInCondition(bool theValue); void setAllInCondition(bool theValue);
void setLastActionPlayer(unsigned theValue); void setLastActionPlayerID(unsigned theValue);
void collectSets(); void collectSets();
void collectPot(); void collectPot();
@@ -74,7 +74,7 @@ private:
int sets; int sets;
unsigned dealerPosition; unsigned dealerPosition;
bool allInCondition; bool allInCondition;
unsigned lastActionPlayer; unsigned lastActionPlayerID;
}; };
#endif #endif
+9 -9
View File
@@ -23,7 +23,7 @@ using namespace std;
ClientHand::ClientHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC) ClientHand::ClientHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC)
: myFactory(f), myGui(g), myBoard(b), myLog(l), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myID(id), startQuantityPlayers(sP), dealerPosition(dP), currentRound(GAME_STATE_PREFLOP), : myFactory(f), myGui(g), myBoard(b), myLog(l), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myID(id), startQuantityPlayers(sP), dealerPosition(dP), currentRound(GAME_STATE_PREFLOP),
smallBlind(sB), startCash(sC), lastPlayersTurn(-1), allInCondition(0), smallBlind(sB), startCash(sC), previousPlayerID(-1), allInCondition(0),
cardsShown(false), bettingRoundsPlayed(0) cardsShown(false), bettingRoundsPlayed(0)
{ {
PlayerListIterator it; PlayerListIterator it;
@@ -287,31 +287,31 @@ ClientHand::getBettingRoundsPlayed() const
} }
void void
ClientHand::setLastPlayersTurn(int theValue) ClientHand::setPreviousPlayerID(int theValue)
{ {
boost::recursive_mutex::scoped_lock lock(m_syncMutex); boost::recursive_mutex::scoped_lock lock(m_syncMutex);
lastPlayersTurn = theValue; previousPlayerID = theValue;
} }
int int
ClientHand::getLastPlayersTurn() const ClientHand::getPreviousPlayerID() const
{ {
boost::recursive_mutex::scoped_lock lock(m_syncMutex); boost::recursive_mutex::scoped_lock lock(m_syncMutex);
return lastPlayersTurn; return previousPlayerID;
} }
void void
ClientHand::setLastActionPlayer (unsigned theValue) ClientHand::setLastActionPlayerID (unsigned theValue)
{ {
boost::recursive_mutex::scoped_lock lock(m_syncMutex); boost::recursive_mutex::scoped_lock lock(m_syncMutex);
lastActionPlayer = theValue; lastActionPlayerID = theValue;
} }
unsigned unsigned
ClientHand::getLastActionPlayer() const ClientHand::getLastActionPlayerID() const
{ {
boost::recursive_mutex::scoped_lock lock(m_syncMutex); boost::recursive_mutex::scoped_lock lock(m_syncMutex);
return lastActionPlayer; return lastActionPlayerID;
} }
void void
+6 -6
View File
@@ -81,11 +81,11 @@ public:
void setBettingRoundsPlayed ( int theValue ); void setBettingRoundsPlayed ( int theValue );
int getBettingRoundsPlayed() const; int getBettingRoundsPlayed() const;
void setLastPlayersTurn ( int theValue ); void setPreviousPlayerID ( int theValue );
int getLastPlayersTurn() const; int getPreviousPlayerID() const;
void setLastActionPlayer ( unsigned theValue ); void setLastActionPlayerID ( unsigned theValue );
unsigned getLastActionPlayer() const; unsigned getLastActionPlayerID() const;
void setCardsShown ( bool theValue ); void setCardsShown ( bool theValue );
bool getCardsShown() const; bool getCardsShown() const;
@@ -119,8 +119,8 @@ private:
int smallBlind; int smallBlind;
int startCash; int startCash;
int lastPlayersTurn; int previousPlayerID;
unsigned lastActionPlayer; unsigned lastActionPlayerID;
bool allInCondition; bool allInCondition;
bool cardsShown; bool cardsShown;
+19 -19
View File
@@ -1824,11 +1824,11 @@ void gameTableImpl::myFold()
boost::shared_ptr<HandInterface> currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand(); boost::shared_ptr<HandInterface> currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand();
boost::shared_ptr<PlayerInterface> humanPlayer = currentHand->getSeatsList()->front(); boost::shared_ptr<PlayerInterface> humanPlayer = currentHand->getSeatsList()->front();
humanPlayer->setMyAction(PLAYER_ACTION_FOLD); humanPlayer->setMyAction(PLAYER_ACTION_FOLD);
currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_FOLD); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_FOLD);
humanPlayer->setMyTurn(0); humanPlayer->setMyTurn(0);
//set that i was the last active player. need this for unhighlighting groupbox //set that i was the last active player. need this for unhighlighting groupbox
currentHand->setLastPlayersTurn(0); currentHand->setPreviousPlayerID(0);
// statusBar()->clearMessage(); // statusBar()->clearMessage();
@@ -1843,11 +1843,11 @@ void gameTableImpl::myCheck()
boost::shared_ptr<HandInterface> currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand(); boost::shared_ptr<HandInterface> currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand();
boost::shared_ptr<PlayerInterface> humanPlayer = currentHand->getSeatsList()->front(); boost::shared_ptr<PlayerInterface> humanPlayer = currentHand->getSeatsList()->front();
humanPlayer->setMyTurn(0); humanPlayer->setMyTurn(0);
currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_CHECK); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_CHECK);
humanPlayer->setMyAction(PLAYER_ACTION_CHECK); humanPlayer->setMyAction(PLAYER_ACTION_CHECK);
//set that i was the last active player. need this for unhighlighting groupbox //set that i was the last active player. need this for unhighlighting groupbox
currentHand->setLastPlayersTurn(0); currentHand->setPreviousPlayerID(0);
// statusBar()->clearMessage(); // statusBar()->clearMessage();
@@ -1910,11 +1910,11 @@ void gameTableImpl::myCall()
humanPlayer->setMySet(humanPlayer->getMyCash()); humanPlayer->setMySet(humanPlayer->getMyCash());
humanPlayer->setMyCash(0); humanPlayer->setMyCash(0);
currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_ALL_IN,humanPlayer->getMySet()); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_ALL_IN,humanPlayer->getMySet());
humanPlayer->setMyAction(PLAYER_ACTION_ALLIN); humanPlayer->setMyAction(PLAYER_ACTION_ALLIN);
} else { } else {
humanPlayer->setMySet(tempHighestSet - humanPlayer->getMySet()); humanPlayer->setMySet(tempHighestSet - humanPlayer->getMySet());
currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_CALL,humanPlayer->getMySet()); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_CALL,humanPlayer->getMySet());
humanPlayer->setMyAction(PLAYER_ACTION_CALL); humanPlayer->setMyAction(PLAYER_ACTION_CALL);
} }
humanPlayer->setMyTurn(0); humanPlayer->setMyTurn(0);
@@ -1923,7 +1923,7 @@ void gameTableImpl::myCall()
refreshPot(); refreshPot();
//set that i was the last active player. need this for unhighlighting groupbox //set that i was the last active player. need this for unhighlighting groupbox
currentHand->setLastPlayersTurn(0); currentHand->setPreviousPlayerID(0);
// statusBar()->clearMessage(); // statusBar()->clearMessage();
@@ -1949,7 +1949,7 @@ void gameTableImpl::mySet()
humanPlayer->setMySet(humanPlayer->getMyCash()); humanPlayer->setMySet(humanPlayer->getMyCash());
humanPlayer->setMyCash(0); humanPlayer->setMyCash(0);
humanPlayer->setMyAction(PLAYER_ACTION_ALLIN); humanPlayer->setMyAction(PLAYER_ACTION_ALLIN);
currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_ALL_IN,humanPlayer->getMySet()); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_ALL_IN,humanPlayer->getMySet());
// full bet rule // full bet rule
if(currentHand->getCurrentBeRo()->getHighestSet() + currentHand->getCurrentBeRo()->getMinimumRaise() > humanPlayer->getMySet()) { if(currentHand->getCurrentBeRo()->getHighestSet() + currentHand->getCurrentBeRo()->getMinimumRaise() > humanPlayer->getMySet()) {
@@ -1961,7 +1961,7 @@ void gameTableImpl::mySet()
//do not if allIn //do not if allIn
if(humanPlayer->getMyAction() != 6) { if(humanPlayer->getMyAction() != 6) {
humanPlayer->setMyAction(PLAYER_ACTION_RAISE); humanPlayer->setMyAction(PLAYER_ACTION_RAISE);
currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_BET,humanPlayer->getMySet()); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_BET,humanPlayer->getMySet());
} }
myActionIsRaise = 0; myActionIsRaise = 0;
@@ -1972,7 +1972,7 @@ void gameTableImpl::mySet()
//do not if allIn //do not if allIn
if(humanPlayer->getMyAction() != 6) { if(humanPlayer->getMyAction() != 6) {
humanPlayer->setMyAction(PLAYER_ACTION_BET); humanPlayer->setMyAction(PLAYER_ACTION_BET);
currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_BET,humanPlayer->getMySet()); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_BET,humanPlayer->getMySet());
} }
myActionIsBet = 0; myActionIsBet = 0;
@@ -1989,10 +1989,10 @@ void gameTableImpl::mySet()
// statusBar()->clearMessage(); // statusBar()->clearMessage();
//set that i was the last active player. need this for unhighlighting groupbox //set that i was the last active player. need this for unhighlighting groupbox
currentHand->setLastPlayersTurn(0); currentHand->setPreviousPlayerID(0);
// lastPlayerAction für Karten umblättern reihenfolge setzrn // lastPlayerAction für Karten umblättern reihenfolge setzrn
currentHand->setLastActionPlayer(humanPlayer->getMyUniqueID()); currentHand->setLastActionPlayerID(humanPlayer->getMyUniqueID());
//Spiel läuft weiter //Spiel läuft weiter
myActionDone(); myActionDone();
@@ -2010,7 +2010,7 @@ void gameTableImpl::myAllIn()
humanPlayer->setMySet(humanPlayer->getMyCash()); humanPlayer->setMySet(humanPlayer->getMyCash());
humanPlayer->setMyCash(0); humanPlayer->setMyCash(0);
humanPlayer->setMyAction(PLAYER_ACTION_ALLIN); humanPlayer->setMyAction(PLAYER_ACTION_ALLIN);
currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_ALL_IN,humanPlayer->getMySet()); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_ALL_IN,humanPlayer->getMySet());
// full bet rule // full bet rule
if(currentHand->getCurrentBeRo()->getHighestSet() + currentHand->getCurrentBeRo()->getMinimumRaise() > humanPlayer->getMySet()) { if(currentHand->getCurrentBeRo()->getHighestSet() + currentHand->getCurrentBeRo()->getMinimumRaise() > humanPlayer->getMySet()) {
@@ -2023,7 +2023,7 @@ void gameTableImpl::myAllIn()
currentHand->getCurrentBeRo()->setHighestSet(humanPlayer->getMySet()); currentHand->getCurrentBeRo()->setHighestSet(humanPlayer->getMySet());
// lastPlayerAction für Karten umblättern reihenfolge setzrn // lastPlayerAction für Karten umblättern reihenfolge setzrn
currentHand->setLastActionPlayer(humanPlayer->getMyUniqueID()); currentHand->setLastActionPlayerID(humanPlayer->getMyUniqueID());
} }
@@ -2033,7 +2033,7 @@ void gameTableImpl::myAllIn()
refreshPot(); refreshPot();
//set that i was the last active player. need this for unhighlighting groupbox //set that i was the last active player. need this for unhighlighting groupbox
currentHand->setLastPlayersTurn(0); currentHand->setPreviousPlayerID(0);
//Spiel läuft weiter //Spiel läuft weiter
myActionDone(); myActionDone();
@@ -2174,11 +2174,11 @@ void gameTableImpl::nextPlayerAnimation()
PlayerListConstIterator it_c; PlayerListConstIterator it_c;
PlayerList seatsList = currentHand->getSeatsList(); PlayerList seatsList = currentHand->getSeatsList();
for (it_c=seatsList->begin(); it_c!=seatsList->end(); ++it_c) { for (it_c=seatsList->begin(); it_c!=seatsList->end(); ++it_c) {
if((*it_c)->getMyID() == currentHand->getLastPlayersTurn()) break; if((*it_c)->getMyID() == currentHand->getPreviousPlayerID()) break;
} }
if(currentHand->getLastPlayersTurn() != -1) { if(currentHand->getPreviousPlayerID() != -1) {
refreshAction(currentHand->getLastPlayersTurn(), (*it_c)->getMyAction()); refreshAction(currentHand->getPreviousPlayerID(), (*it_c)->getMyAction());
} }
refreshCash(); refreshCash();
@@ -3229,7 +3229,7 @@ void gameTableImpl::updateMyButtonsState(int mode)
boost::shared_ptr<HandInterface> currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand(); boost::shared_ptr<HandInterface> currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand();
if(currentHand->getLastPlayersTurn() == 0) { if(currentHand->getPreviousPlayerID() == 0) {
myButtonsCheckable(FALSE); myButtonsCheckable(FALSE);
clearMyButtons(); clearMyButtons();
} else { } else {
+4 -4
View File
@@ -1753,7 +1753,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client,
netActionDone->totalPlayerBet - tmpPlayer->getMySet()); netActionDone->totalPlayerBet - tmpPlayer->getMySet());
} }
// Update last players turn only after the blinds. // Update last players turn only after the blinds.
curGame->getCurrentHand()->setLastPlayersTurn(tmpPlayer->getMyID()); curGame->getCurrentHand()->setPreviousPlayerID(tmpPlayer->getMyID());
} }
tmpPlayer->setMyAction(PlayerAction(netActionDone->playerAction)); tmpPlayer->setMyAction(PlayerAction(netActionDone->playerAction));
@@ -1832,7 +1832,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client,
tmpCards[3] = tmpCards[4] = 0; tmpCards[3] = tmpCards[4] = 0;
curGame->getCurrentHand()->getBoard()->setMyCards(tmpCards); curGame->getCurrentHand()->getBoard()->setMyCards(tmpCards);
curGame->getCurrentHand()->getBoard()->collectPot(); curGame->getCurrentHand()->getBoard()->collectPot();
curGame->getCurrentHand()->setLastPlayersTurn(-1); curGame->getCurrentHand()->setPreviousPlayerID(-1);
client->GetGui().logDealBoardCardsMsg(GAME_STATE_FLOP, tmpCards[0], tmpCards[1], tmpCards[2], tmpCards[3], tmpCards[4]); client->GetGui().logDealBoardCardsMsg(GAME_STATE_FLOP, tmpCards[0], tmpCards[1], tmpCards[2], tmpCards[3], tmpCards[4]);
client->GetGui().refreshGameLabels(GAME_STATE_FLOP); client->GetGui().refreshGameLabels(GAME_STATE_FLOP);
@@ -1847,7 +1847,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client,
tmpCards[3] = static_cast<int>(netDealTurn->turnCard); tmpCards[3] = static_cast<int>(netDealTurn->turnCard);
curGame->getCurrentHand()->getBoard()->setMyCards(tmpCards); curGame->getCurrentHand()->getBoard()->setMyCards(tmpCards);
curGame->getCurrentHand()->getBoard()->collectPot(); curGame->getCurrentHand()->getBoard()->collectPot();
curGame->getCurrentHand()->setLastPlayersTurn(-1); curGame->getCurrentHand()->setPreviousPlayerID(-1);
client->GetGui().logDealBoardCardsMsg(GAME_STATE_TURN, tmpCards[0], tmpCards[1], tmpCards[2], tmpCards[3], tmpCards[4]); client->GetGui().logDealBoardCardsMsg(GAME_STATE_TURN, tmpCards[0], tmpCards[1], tmpCards[2], tmpCards[3], tmpCards[4]);
client->GetGui().refreshGameLabels(GAME_STATE_TURN); client->GetGui().refreshGameLabels(GAME_STATE_TURN);
@@ -1862,7 +1862,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client,
tmpCards[4] = static_cast<int>(netDealRiver->riverCard); tmpCards[4] = static_cast<int>(netDealRiver->riverCard);
curGame->getCurrentHand()->getBoard()->setMyCards(tmpCards); curGame->getCurrentHand()->getBoard()->setMyCards(tmpCards);
curGame->getCurrentHand()->getBoard()->collectPot(); curGame->getCurrentHand()->getBoard()->collectPot();
curGame->getCurrentHand()->setLastPlayersTurn(-1); curGame->getCurrentHand()->setPreviousPlayerID(-1);
client->GetGui().logDealBoardCardsMsg(GAME_STATE_RIVER, tmpCards[0], tmpCards[1], tmpCards[2], tmpCards[3], tmpCards[4]); client->GetGui().logDealBoardCardsMsg(GAME_STATE_RIVER, tmpCards[0], tmpCards[1], tmpCards[2], tmpCards[3], tmpCards[4]);
client->GetGui().refreshGameLabels(GAME_STATE_RIVER); client->GetGui().refreshGameLabels(GAME_STATE_RIVER);
+3 -3
View File
@@ -154,12 +154,12 @@ static void PerformPlayerAction(ServerGame &server, boost::shared_ptr<PlayerInte
switch(action) { switch(action) {
case PLAYER_ACTION_BET: { case PLAYER_ACTION_BET: {
curGame.getCurrentHand()->getCurrentBeRo()->setMinimumRaise(bet); curGame.getCurrentHand()->getCurrentBeRo()->setMinimumRaise(bet);
curGame.getCurrentHand()->setLastActionPlayer(player->getMyUniqueID()); curGame.getCurrentHand()->setLastActionPlayerID(player->getMyUniqueID());
} }
break; break;
case PLAYER_ACTION_RAISE: { case PLAYER_ACTION_RAISE: {
curGame.getCurrentHand()->getCurrentBeRo()->setMinimumRaise(player->getMySet() - curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet()); curGame.getCurrentHand()->getCurrentBeRo()->setMinimumRaise(player->getMySet() - curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet());
curGame.getCurrentHand()->setLastActionPlayer(player->getMyUniqueID()); curGame.getCurrentHand()->setLastActionPlayerID(player->getMyUniqueID());
} }
break; break;
case PLAYER_ACTION_ALLIN: { case PLAYER_ACTION_ALLIN: {
@@ -167,7 +167,7 @@ static void PerformPlayerAction(ServerGame &server, boost::shared_ptr<PlayerInte
curGame.getCurrentHand()->getCurrentBeRo()->setMinimumRaise(player->getMySet() - curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet()); curGame.getCurrentHand()->getCurrentBeRo()->setMinimumRaise(player->getMySet() - curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet());
} }
if(player->getMySet() - curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet() > 0) { if(player->getMySet() - curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet() > 0) {
curGame.getCurrentHand()->setLastActionPlayer(player->getMyUniqueID()); curGame.getCurrentHand()->setLastActionPlayerID(player->getMyUniqueID());
} }
} }
break; break;