actual -> current ;)
This commit is contained in:
@@ -59,8 +59,8 @@ public:
|
|||||||
virtual void setStartQuantityPlayers(int theValue) =0;
|
virtual void setStartQuantityPlayers(int theValue) =0;
|
||||||
virtual int getStartQuantityPlayers() const =0;
|
virtual int getStartQuantityPlayers() const =0;
|
||||||
|
|
||||||
virtual void setActualRound(int theValue) =0;
|
virtual void setCurrentRound(int theValue) =0;
|
||||||
virtual int getActualRound() const =0;
|
virtual int getCurrentRound() const =0;
|
||||||
|
|
||||||
virtual void setDealerPosition(int theValue) =0;
|
virtual void setDealerPosition(int theValue) =0;
|
||||||
virtual int getDealerPosition() const =0;
|
virtual int getDealerPosition() const =0;
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ void LocalBeRo::run() {
|
|||||||
|
|
||||||
// aktuelle bero nicht dran, weil alle Sets gleich sind
|
// aktuelle bero nicht dran, weil alle Sets gleich sind
|
||||||
//also gehe in naechste bero
|
//also gehe in naechste bero
|
||||||
myHand->setActualRound(myBeRoID+1);
|
myHand->setCurrentRound(myBeRoID+1);
|
||||||
|
|
||||||
//Action loeschen und ActionButtons refresh
|
//Action loeschen und ActionButtons refresh
|
||||||
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
@@ -322,7 +322,7 @@ void LocalBeRo::run() {
|
|||||||
|
|
||||||
//// !!!!!!!!! attention: exception if player failed before !!!!!!!!
|
//// !!!!!!!!! attention: exception if player failed before !!!!!!!!
|
||||||
|
|
||||||
// if( !(myHand->getActualQuantityPlayers() < 3 && firstHeadsUpRound == 1) || myHand->getPlayerArray()[playersTurn]->getMyActiveStatus() == 0 ) {
|
// if( !(myHand->getCurrentQuantityPlayers() < 3 && firstHeadsUpRound == 1) || myHand->getPlayerArray()[playersTurn]->getMyActiveStatus() == 0 ) {
|
||||||
// not first round in heads up (for headsup dealer is smallblind so it is dealers turn)
|
// not first round in heads up (for headsup dealer is smallblind so it is dealers turn)
|
||||||
|
|
||||||
// naechsten Spieler ermitteln
|
// naechsten Spieler ermitteln
|
||||||
|
|||||||
@@ -306,10 +306,10 @@ void LocalBeRoPreflop::run() {
|
|||||||
|
|
||||||
// Preflop nicht dran, weil wir nicht mehr in erster PreflopRunde und alle Sets gleich sind
|
// Preflop nicht dran, weil wir nicht mehr in erster PreflopRunde und alle Sets gleich sind
|
||||||
//also gehe in Flop
|
//also gehe in Flop
|
||||||
getMyHand()->setActualRound(GAME_STATE_FLOP);
|
getMyHand()->setCurrentRound(GAME_STATE_FLOP);
|
||||||
|
|
||||||
// exception no.1 - see above
|
// exception no.1 - see above
|
||||||
// if(getMyHand()->getAllInCondition()) getMyHand()->setActualRound(GAME_STATE_PREFLOP);;
|
// if(getMyHand()->getAllInCondition()) getMyHand()->setCurrentRound(GAME_STATE_PREFLOP);;
|
||||||
|
|
||||||
//Action loeschen und ActionButtons refresh
|
//Action loeschen und ActionButtons refresh
|
||||||
for(it_c=getMyHand()->getRunningPlayerList()->begin(); it_c!=getMyHand()->getRunningPlayerList()->end(); it_c++) {
|
for(it_c=getMyHand()->getRunningPlayerList()->begin(); it_c!=getMyHand()->getRunningPlayerList()->end(); it_c++) {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, std::vector<boost::shared_ptr<PlayerInterface> > sl_old, 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, BoardInterface *b, std::vector<boost::shared_ptr<PlayerInterface> > sl_old, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, unsigned dP, int sB,int sC)
|
||||||
: myFactory(f), myGui(g), myBoard(b), playerArray(sl_old), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myBeRo(0), myID(id), startQuantityPlayers(sP), dealerPosition(dP), actualRound(0), smallBlind(sB), startCash(sC), lastPlayersTurn(0), allInCondition(false),
|
: myFactory(f), myGui(g), myBoard(b), playerArray(sl_old), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myBeRo(0), myID(id), startQuantityPlayers(sP), dealerPosition(dP), currentRound(0), smallBlind(sB), startCash(sC), lastPlayersTurn(0), allInCondition(false),
|
||||||
cardsShown(false), bettingRoundsPlayed(0)
|
cardsShown(false), bettingRoundsPlayed(0)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -551,7 +551,7 @@ void LocalHand::switchRounds() {
|
|||||||
myBoard->collectPot();
|
myBoard->collectPot();
|
||||||
myGui->refreshPot();
|
myGui->refreshPot();
|
||||||
myGui->refreshSet();
|
myGui->refreshSet();
|
||||||
actualRound = 4;
|
currentRound = 4;
|
||||||
}
|
}
|
||||||
// prfen der All In Kondition
|
// prfen der All In Kondition
|
||||||
// fr All In Prozedur mssen mindestens zwei aktive Player vorhanden sein
|
// fr All In Prozedur mssen mindestens zwei aktive Player vorhanden sein
|
||||||
@@ -568,7 +568,7 @@ void LocalHand::switchRounds() {
|
|||||||
// TODO -> runningPlayerList s.u.
|
// TODO -> runningPlayerList s.u.
|
||||||
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
//
|
//
|
||||||
// if(playerArray[i]->getMyAction() != 1 && playerArray[i]->getMyAction() != 6 && playerArray[i]->getMyActiveStatus() == 1 && playerArray[i]->getMySet() >= myBeRo[actualRound]->getHighestSet()) {
|
// if(playerArray[i]->getMyAction() != 1 && playerArray[i]->getMyAction() != 6 && playerArray[i]->getMyActiveStatus() == 1 && playerArray[i]->getMySet() >= myBeRo[currentRound]->getHighestSet()) {
|
||||||
// allInCondition = 1;
|
// allInCondition = 1;
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
@@ -577,13 +577,13 @@ void LocalHand::switchRounds() {
|
|||||||
|
|
||||||
for(it_c=runningPlayerList->begin(); it_c!=runningPlayerList->end(); it_c++) {
|
for(it_c=runningPlayerList->begin(); it_c!=runningPlayerList->end(); it_c++) {
|
||||||
|
|
||||||
if((*it_c)->getMySet() >= myBeRo[actualRound]->getHighestSet()) {
|
if((*it_c)->getMySet() >= myBeRo[currentRound]->getHighestSet()) {
|
||||||
allInCondition = true;
|
allInCondition = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if( (*(runningPlayerList.begin()))->getMySet() >= myBeRo[actualRound]->getHighestSet() ) {
|
// if( (*(runningPlayerList.begin()))->getMySet() >= myBeRo[currentRound]->getHighestSet() ) {
|
||||||
// allInCondition = 1;
|
// allInCondition = 1;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@@ -600,9 +600,9 @@ void LocalHand::switchRounds() {
|
|||||||
|
|
||||||
// exception
|
// exception
|
||||||
// no.1: if in first Preflop Round next player is small blind and only all-in-big-blind with less than smallblind amount and other all-in players with less than small blind are nonfold too -> preflop is over
|
// no.1: if in first Preflop Round next player is small blind and only all-in-big-blind with less than smallblind amount and other all-in players with less than small blind are nonfold too -> preflop is over
|
||||||
PlayerListConstIterator smallBlindIt_c = getRunningPlayerIt(myBeRo[actualRound]->getSmallBlindPositionId());
|
PlayerListConstIterator smallBlindIt_c = getRunningPlayerIt(myBeRo[currentRound]->getSmallBlindPositionId());
|
||||||
PlayerListConstIterator bigBlindIt_c = getActivePlayerIt(myBeRo[actualRound]->getBigBlindPositionId());
|
PlayerListConstIterator bigBlindIt_c = getActivePlayerIt(myBeRo[currentRound]->getBigBlindPositionId());
|
||||||
if(smallBlindIt_c!=runningPlayerList->end() && bigBlindIt_c!=activePlayerList->end() && actualRound == GAME_STATE_PREFLOP && myBeRo[actualRound]->getFirstRound()) {
|
if(smallBlindIt_c!=runningPlayerList->end() && bigBlindIt_c!=activePlayerList->end() && currentRound == GAME_STATE_PREFLOP && myBeRo[currentRound]->getFirstRound()) {
|
||||||
// determine player who are all in with less than small blind amount
|
// determine player who are all in with less than small blind amount
|
||||||
int tempCounter = 0;
|
int tempCounter = 0;
|
||||||
for(it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); it_c++) {
|
for(it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); it_c++) {
|
||||||
@@ -637,15 +637,15 @@ void LocalHand::switchRounds() {
|
|||||||
myGui->refreshSet();
|
myGui->refreshSet();
|
||||||
myGui->flipHolecardsAllIn();
|
myGui->flipHolecardsAllIn();
|
||||||
|
|
||||||
if (actualRound < 4) // do not increment past 4
|
if (currentRound < 4) // do not increment past 4
|
||||||
actualRound++;
|
currentRound++;
|
||||||
|
|
||||||
//log board cards for allin
|
//log board cards for allin
|
||||||
if(actualRound >= 1) {
|
if(currentRound >= 1) {
|
||||||
int tempBoardCardsArray[5];
|
int tempBoardCardsArray[5];
|
||||||
|
|
||||||
myBoard->getMyCards(tempBoardCardsArray);
|
myBoard->getMyCards(tempBoardCardsArray);
|
||||||
myGui->logDealBoardCardsMsg(actualRound, tempBoardCardsArray[0], tempBoardCardsArray[1], tempBoardCardsArray[2], tempBoardCardsArray[3], tempBoardCardsArray[4]);
|
myGui->logDealBoardCardsMsg(currentRound, tempBoardCardsArray[0], tempBoardCardsArray[1], tempBoardCardsArray[2], tempBoardCardsArray[3], tempBoardCardsArray[4]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -664,13 +664,13 @@ void LocalHand::switchRounds() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
myGui->refreshGameLabels((GameState)getActualRound());
|
myGui->refreshGameLabels((GameState)getCurrentRound());
|
||||||
// /*/*/*/*cout <<*/*/*/*/ "NextPlayerSpeed1 stop" << endl;
|
// /*/*/*/*cout <<*/*/*/*/ "NextPlayerSpeed1 stop" << endl;
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
// cout << "NextPlayerSpeed2 start" << endl;
|
// cout << "NextPlayerSpeed2 start" << endl;
|
||||||
switch(actualRound) {
|
switch(currentRound) {
|
||||||
case 0: {
|
case 0: {
|
||||||
// Preflop starten
|
// Preflop starten
|
||||||
myGui->preflopAnimation1();
|
myGui->preflopAnimation1();
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public:
|
|||||||
boost::shared_ptr<BeRoInterface> getTurn() const { return myBeRo[GAME_STATE_TURN]; }
|
boost::shared_ptr<BeRoInterface> getTurn() const { return myBeRo[GAME_STATE_TURN]; }
|
||||||
boost::shared_ptr<BeRoInterface> getRiver() const { return myBeRo[GAME_STATE_RIVER]; }
|
boost::shared_ptr<BeRoInterface> getRiver() const { return myBeRo[GAME_STATE_RIVER]; }
|
||||||
GuiInterface* getGuiInterface() const { return myGui; }
|
GuiInterface* getGuiInterface() const { return myGui; }
|
||||||
boost::shared_ptr<BeRoInterface> getCurrentBeRo() const { return myBeRo[actualRound]; }
|
boost::shared_ptr<BeRoInterface> getCurrentBeRo() const { return myBeRo[currentRound]; }
|
||||||
|
|
||||||
void setMyID(int theValue) { myID = theValue; }
|
void setMyID(int theValue) { myID = theValue; }
|
||||||
int getMyID() const { return myID; }
|
int getMyID() const { return myID; }
|
||||||
@@ -62,8 +62,8 @@ public:
|
|||||||
void setStartQuantityPlayers(int theValue) { startQuantityPlayers = theValue; }
|
void setStartQuantityPlayers(int theValue) { startQuantityPlayers = theValue; }
|
||||||
int getStartQuantityPlayers() const { return startQuantityPlayers; }
|
int getStartQuantityPlayers() const { return startQuantityPlayers; }
|
||||||
|
|
||||||
void setActualRound(int theValue) { actualRound = theValue; }
|
void setCurrentRound(int theValue) { currentRound = theValue; }
|
||||||
int getActualRound() const { return actualRound; }
|
int getCurrentRound() const { return currentRound; }
|
||||||
|
|
||||||
void setDealerPosition(int theValue) { dealerPosition = theValue; }
|
void setDealerPosition(int theValue) { dealerPosition = theValue; }
|
||||||
int getDealerPosition() const { return dealerPosition; }
|
int getDealerPosition() const { return dealerPosition; }
|
||||||
@@ -107,7 +107,7 @@ private:
|
|||||||
int myID;
|
int myID;
|
||||||
int startQuantityPlayers;
|
int startQuantityPlayers;
|
||||||
unsigned dealerPosition; // -1 -> neutral
|
unsigned dealerPosition; // -1 -> neutral
|
||||||
int actualRound; //0 = preflop, 1 = flop, 2 = turn, 3 = river
|
int currentRound; //0 = preflop, 1 = flop, 2 = turn, 3 = river
|
||||||
int smallBlind;
|
int smallBlind;
|
||||||
int startCash;
|
int startCash;
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -67,7 +67,7 @@ public:
|
|||||||
void setMyAction(int theValue, bool blind = 0) {
|
void setMyAction(int theValue, bool blind = 0) {
|
||||||
myAction = theValue;
|
myAction = theValue;
|
||||||
// logging for human player
|
// logging for human player
|
||||||
if(myAction && !blind) actualHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet);
|
if(myAction && !blind) currentHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet);
|
||||||
}
|
}
|
||||||
int getMyAction() const { return myAction; }
|
int getMyAction() const { return myAction; }
|
||||||
|
|
||||||
@@ -88,11 +88,11 @@ public:
|
|||||||
// log flipping cards
|
// log flipping cards
|
||||||
if(myCardsFlip) {
|
if(myCardsFlip) {
|
||||||
switch(state) {
|
switch(state) {
|
||||||
case 1: actualHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt);
|
case 1: currentHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt);
|
||||||
break;
|
break;
|
||||||
case 2: actualHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1]);
|
case 2: currentHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1]);
|
||||||
break;
|
break;
|
||||||
case 3: actualHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt, "has");
|
case 3: currentHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt, "has");
|
||||||
break;
|
break;
|
||||||
default: ;
|
default: ;
|
||||||
}
|
}
|
||||||
@@ -143,7 +143,7 @@ public:
|
|||||||
|
|
||||||
void setMyWinnerState ( bool theValue, int pot ) {
|
void setMyWinnerState ( bool theValue, int pot ) {
|
||||||
if(theValue) myWinnerState = theValue;
|
if(theValue) myWinnerState = theValue;
|
||||||
actualHand->getGuiInterface()->logPlayerWinsMsg(myName, pot, theValue);
|
currentHand->getGuiInterface()->logPlayerWinsMsg(myName, pot, theValue);
|
||||||
}
|
}
|
||||||
bool getMyWinnerState() const { return myWinnerState;}
|
bool getMyWinnerState() const { return myWinnerState;}
|
||||||
|
|
||||||
@@ -179,8 +179,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
ConfigFile *myConfig;
|
ConfigFile *myConfig;
|
||||||
HandInterface *actualHand;
|
HandInterface *currentHand;
|
||||||
BoardInterface *actualBoard;
|
BoardInterface *currentBoard;
|
||||||
|
|
||||||
CardsValue *myCardsValue;
|
CardsValue *myCardsValue;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
ClientBoard::ClientBoard()
|
ClientBoard::ClientBoard()
|
||||||
: playerArray(0), actualHand(0), pot(0), sets(0)
|
: playerArray(0), currentHand(0), pot(0), sets(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ void
|
|||||||
ClientBoard::setHand(HandInterface* br)
|
ClientBoard::setHand(HandInterface* br)
|
||||||
{
|
{
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
actualHand = br;
|
currentHand = br;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ private:
|
|||||||
PlayerList activePlayerList;
|
PlayerList activePlayerList;
|
||||||
PlayerList runningPlayerList;
|
PlayerList runningPlayerList;
|
||||||
|
|
||||||
HandInterface *actualHand;
|
HandInterface *currentHand;
|
||||||
|
|
||||||
std::list<int> winners;
|
std::list<int> winners;
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
ClientHand::ClientHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, std::vector<boost::shared_ptr<PlayerInterface> > sl_old, 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, BoardInterface *b, std::vector<boost::shared_ptr<PlayerInterface> > sl_old, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC)
|
||||||
: myFactory(f), myGui(g), myBoard(b), playerArray(sl_old), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myID(id), startQuantityPlayers(sP), dealerPosition(dP), actualRound(0),
|
: myFactory(f), myGui(g), myBoard(b), playerArray(sl_old), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myID(id), startQuantityPlayers(sP), dealerPosition(dP), currentRound(0),
|
||||||
smallBlind(sB), startCash(sC), lastPlayersTurn(0), allInCondition(0),
|
smallBlind(sB), startCash(sC), lastPlayersTurn(0), allInCondition(0),
|
||||||
cardsShown(false), bettingRoundsPlayed(0)
|
cardsShown(false), bettingRoundsPlayed(0)
|
||||||
{
|
{
|
||||||
@@ -166,7 +166,7 @@ ClientHand::getRiver() const
|
|||||||
boost::shared_ptr<BeRoInterface>
|
boost::shared_ptr<BeRoInterface>
|
||||||
ClientHand::getCurrentBeRo() const
|
ClientHand::getCurrentBeRo() const
|
||||||
{
|
{
|
||||||
return myBeRo[actualRound];
|
return myBeRo[currentRound];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -205,17 +205,17 @@ ClientHand::getStartQuantityPlayers() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ClientHand::setActualRound(int theValue)
|
ClientHand::setCurrentRound(int theValue)
|
||||||
{
|
{
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
actualRound = theValue;
|
currentRound = theValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ClientHand::getActualRound() const
|
ClientHand::getCurrentRound() const
|
||||||
{
|
{
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
return actualRound;
|
return currentRound;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -57,14 +57,14 @@ class ClientHand : public HandInterface
|
|||||||
void setMyID ( int theValue );
|
void setMyID ( int theValue );
|
||||||
int getMyID() const;
|
int getMyID() const;
|
||||||
|
|
||||||
void setActualQuantityPlayers ( int theValue );
|
void setCurrentQuantityPlayers ( int theValue );
|
||||||
int getActualQuantityPlayers() const;
|
int getCurrentQuantityPlayers() const;
|
||||||
|
|
||||||
void setStartQuantityPlayers ( int theValue );
|
void setStartQuantityPlayers ( int theValue );
|
||||||
int getStartQuantityPlayers() const;
|
int getStartQuantityPlayers() const;
|
||||||
|
|
||||||
void setActualRound ( int theValue );
|
void setCurrentRound ( int theValue );
|
||||||
int getActualRound() const;
|
int getCurrentRound() const;
|
||||||
|
|
||||||
void setDealerPosition ( int theValue );
|
void setDealerPosition ( int theValue );
|
||||||
int getDealerPosition() const;
|
int getDealerPosition() const;
|
||||||
@@ -106,8 +106,8 @@ class ClientHand : public HandInterface
|
|||||||
|
|
||||||
int myID;
|
int myID;
|
||||||
int startQuantityPlayers;
|
int startQuantityPlayers;
|
||||||
int dealerPosition; // -1 -> neutral
|
unsigned dealerPosition;
|
||||||
int actualRound; //0 = preflop, 1 = flop, 2 = turn, 3 = river
|
int currentRound; //0 = preflop, 1 = flop, 2 = turn, 3 = river
|
||||||
int smallBlind;
|
int smallBlind;
|
||||||
int startCash;
|
int startCash;
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ using namespace std;
|
|||||||
|
|
||||||
|
|
||||||
ClientPlayer::ClientPlayer(ConfigFile *c, BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB)
|
ClientPlayer::ClientPlayer(ConfigFile *c, BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB)
|
||||||
: PlayerInterface(), myConfig(c), actualHand(0), actualBoard(b), myCardsValue(0), myID(id), myUniqueID(uniqueId), myType(type), myName(name), myAvatar(avatar), myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), myCash(sC), mySet(0), myLastRelativeSet(0), myAction(0), myButton(mB), myActiveStatus(aS), myTurn(0), myRoundStartCash(0), sBluff(0), sBluffStatus(0)
|
: PlayerInterface(), myConfig(c), currentHand(0), currentBoard(b), myCardsValue(0), myID(id), myUniqueID(uniqueId), myType(type), myName(name), myAvatar(avatar), myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), myCash(sC), mySet(0), myLastRelativeSet(0), myAction(0), myButton(mB), myActiveStatus(aS), myTurn(0), myRoundStartCash(0), sBluff(0), sBluffStatus(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ void
|
|||||||
ClientPlayer::setHand(HandInterface* br)
|
ClientPlayer::setHand(HandInterface* br)
|
||||||
{
|
{
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
actualHand = br;
|
currentHand = br;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@@ -244,11 +244,11 @@ ClientPlayer::setMyCardsFlip(bool theValue, int state)
|
|||||||
// log flipping cards
|
// log flipping cards
|
||||||
if (myCardsFlip) {
|
if (myCardsFlip) {
|
||||||
switch(state) {
|
switch(state) {
|
||||||
case 1: actualHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt);
|
case 1: currentHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt);
|
||||||
break;
|
break;
|
||||||
case 2: actualHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1]);
|
case 2: currentHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1]);
|
||||||
break;
|
break;
|
||||||
case 3: actualHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt, "has");
|
case 3: currentHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt, "has");
|
||||||
break;
|
break;
|
||||||
default: ;
|
default: ;
|
||||||
}
|
}
|
||||||
@@ -379,7 +379,7 @@ ClientPlayer::setMyWinnerState(bool theValue, int pot)
|
|||||||
{
|
{
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
if(theValue) myWinnerState = theValue;
|
if(theValue) myWinnerState = theValue;
|
||||||
actualHand->getGuiInterface()->logPlayerWinsMsg(myName, pot, theValue);
|
currentHand->getGuiInterface()->logPlayerWinsMsg(myName, pot, theValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|||||||
@@ -132,8 +132,8 @@ private:
|
|||||||
mutable boost::recursive_mutex m_syncMutex;
|
mutable boost::recursive_mutex m_syncMutex;
|
||||||
|
|
||||||
ConfigFile *myConfig;
|
ConfigFile *myConfig;
|
||||||
HandInterface *actualHand;
|
HandInterface *currentHand;
|
||||||
BoardInterface *actualBoard;
|
BoardInterface *currentBoard;
|
||||||
|
|
||||||
CardsValue *myCardsValue;
|
CardsValue *myCardsValue;
|
||||||
|
|
||||||
|
|||||||
+31
-31
@@ -33,10 +33,10 @@ using namespace std;
|
|||||||
Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
|
Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
|
||||||
const PlayerDataList &playerDataList, const GameData &gameData,
|
const PlayerDataList &playerDataList, const GameData &gameData,
|
||||||
const StartData &startData, int gameId)
|
const StartData &startData, int gameId)
|
||||||
: myFactory(factory), myGui(gui), actualHand(0), actualBoard(0),
|
: myFactory(factory), myGui(gui), currentHand(0), currentBoard(0),
|
||||||
startQuantityPlayers(startData.numberOfPlayers),
|
startQuantityPlayers(startData.numberOfPlayers),
|
||||||
startCash(gameData.startMoney), startSmallBlind(gameData.firstSmallBlind),
|
startCash(gameData.startMoney), startSmallBlind(gameData.firstSmallBlind),
|
||||||
myGameID(gameId), actualSmallBlind(gameData.firstSmallBlind), actualHandID(0), dealerPosition(0), lastHandBlindsRaised(1), lastTimeBlindsRaised(0), myGameData(gameData)
|
myGameID(gameId), currentSmallBlind(gameData.firstSmallBlind), currentHandID(0), dealerPosition(0), lastHandBlindsRaised(1), lastTimeBlindsRaised(0), myGameData(gameData)
|
||||||
{
|
{
|
||||||
|
|
||||||
blindsList = myGameData.manualBlindsList;
|
blindsList = myGameData.manualBlindsList;
|
||||||
@@ -44,13 +44,13 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
|
|||||||
|
|
||||||
if(DEBUG_MODE) {
|
if(DEBUG_MODE) {
|
||||||
startSmallBlind = 10;
|
startSmallBlind = 10;
|
||||||
actualSmallBlind = startSmallBlind;
|
currentSmallBlind = startSmallBlind;
|
||||||
}
|
}
|
||||||
|
|
||||||
// cout << "Create Game Object" << "\n";
|
// cout << "Create Game Object" << "\n";
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
actualHandID = 0;
|
currentHandID = 0;
|
||||||
|
|
||||||
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
// playerArray[i] = 0;
|
// playerArray[i] = 0;
|
||||||
@@ -71,7 +71,7 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
|
|||||||
dealerPosition = startData.startDealerPlayerId;
|
dealerPosition = startData.startDealerPlayerId;
|
||||||
|
|
||||||
// Board erstellen
|
// Board erstellen
|
||||||
actualBoard = myFactory->createBoard();
|
currentBoard = myFactory->createBoard();
|
||||||
|
|
||||||
seatsList = PlayerList(new std::list<boost::shared_ptr<PlayerInterface> >);
|
seatsList = PlayerList(new std::list<boost::shared_ptr<PlayerInterface> >);
|
||||||
activePlayerList = PlayerList(new std::list<boost::shared_ptr<PlayerInterface> >);
|
activePlayerList = PlayerList(new std::list<boost::shared_ptr<PlayerInterface> >);
|
||||||
@@ -101,7 +101,7 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create Player Objects
|
// create Player Objects
|
||||||
boost::shared_ptr<PlayerInterface> tmpPlayer = myFactory->createPlayer(actualBoard, i, uniqueId, type, myName, myAvatarFile, startCash, startQuantityPlayers > i, 0);
|
boost::shared_ptr<PlayerInterface> tmpPlayer = myFactory->createPlayer(currentBoard, i, uniqueId, type, myName, myAvatarFile, startCash, startQuantityPlayers > i, 0);
|
||||||
|
|
||||||
tmpPlayer->setNetSessionData(myNetSession);
|
tmpPlayer->setNetSessionData(myNetSession);
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
|
|||||||
playerArray[i]->setNetSessionData(myNetSession); // delete
|
playerArray[i]->setNetSessionData(myNetSession); // delete
|
||||||
|
|
||||||
}
|
}
|
||||||
actualBoard->setPlayerLists(playerArray, seatsList, activePlayerList, runningPlayerList); // delete playerArray
|
currentBoard->setPlayerLists(playerArray, seatsList, activePlayerList, runningPlayerList); // delete playerArray
|
||||||
|
|
||||||
//start timer
|
//start timer
|
||||||
blindsTimer.reset();
|
blindsTimer.reset();
|
||||||
@@ -128,21 +128,21 @@ Game::~Game()
|
|||||||
{
|
{
|
||||||
// cout << "Delete Game Object" << "\n";
|
// cout << "Delete Game Object" << "\n";
|
||||||
|
|
||||||
delete actualBoard;
|
delete currentBoard;
|
||||||
actualBoard = 0;
|
currentBoard = 0;
|
||||||
delete actualHand;
|
delete currentHand;
|
||||||
actualHand = 0;
|
currentHand = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HandInterface *Game::getCurrentHand()
|
HandInterface *Game::getCurrentHand()
|
||||||
{
|
{
|
||||||
return actualHand;
|
return currentHand;
|
||||||
}
|
}
|
||||||
|
|
||||||
const HandInterface *Game::getCurrentHand() const
|
const HandInterface *Game::getCurrentHand() const
|
||||||
{
|
{
|
||||||
return actualHand;
|
return currentHand;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Game::initHand()
|
void Game::initHand()
|
||||||
@@ -152,7 +152,7 @@ void Game::initHand()
|
|||||||
PlayerListConstIterator it_c;
|
PlayerListConstIterator it_c;
|
||||||
PlayerListIterator it, it_2;
|
PlayerListIterator it, it_2;
|
||||||
|
|
||||||
actualHandID++;
|
currentHandID++;
|
||||||
|
|
||||||
// calculate smallBlind
|
// calculate smallBlind
|
||||||
raiseBlinds();
|
raiseBlinds();
|
||||||
@@ -182,16 +182,16 @@ void Game::initHand()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// eventuell vorhandene Hand löschen
|
// eventuell vorhandene Hand löschen
|
||||||
if(actualHand) {
|
if(currentHand) {
|
||||||
delete actualHand;
|
delete currentHand;
|
||||||
actualHand = 0;
|
currentHand = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
runningPlayerList->clear();
|
runningPlayerList->clear();
|
||||||
(*runningPlayerList) = (*activePlayerList);
|
(*runningPlayerList) = (*activePlayerList);
|
||||||
|
|
||||||
// Hand erstellen
|
// Hand erstellen
|
||||||
actualHand = myFactory->createHand(myFactory, myGui, actualBoard, playerArray, seatsList, activePlayerList, runningPlayerList, actualHandID, startQuantityPlayers, dealerPosition, actualSmallBlind, startCash); // delete playerArray
|
currentHand = myFactory->createHand(myFactory, myGui, currentBoard, playerArray, seatsList, activePlayerList, runningPlayerList, currentHandID, startQuantityPlayers, dealerPosition, currentSmallBlind, startCash); // delete playerArray
|
||||||
|
|
||||||
|
|
||||||
// Dealer-Button weiterschieben --> Achtung inactive -> TODO exception-rule !!! DELETE
|
// Dealer-Button weiterschieben --> Achtung inactive -> TODO exception-rule !!! DELETE
|
||||||
@@ -202,7 +202,7 @@ void Game::initHand()
|
|||||||
|
|
||||||
// Dealer-Button weiterschieben --> Achtung inactive -> TODO exception-rule !!!
|
// Dealer-Button weiterschieben --> Achtung inactive -> TODO exception-rule !!!
|
||||||
bool nextDealerFound = false;
|
bool nextDealerFound = false;
|
||||||
PlayerListConstIterator dealerPositionIt = actualHand->getSeatIt(dealerPosition);
|
PlayerListConstIterator dealerPositionIt = currentHand->getSeatIt(dealerPosition);
|
||||||
if(dealerPositionIt == seatsList->end()) {
|
if(dealerPositionIt == seatsList->end()) {
|
||||||
throw LocalException(ERR_SEAT_NOT_FOUND);
|
throw LocalException(ERR_SEAT_NOT_FOUND);
|
||||||
}
|
}
|
||||||
@@ -212,7 +212,7 @@ void Game::initHand()
|
|||||||
dealerPositionIt++;
|
dealerPositionIt++;
|
||||||
if(dealerPositionIt == seatsList->end()) dealerPositionIt = seatsList->begin();
|
if(dealerPositionIt == seatsList->end()) dealerPositionIt = seatsList->begin();
|
||||||
|
|
||||||
it = actualHand->getActivePlayerIt( (*dealerPositionIt)->getMyUniqueID() );
|
it = currentHand->getActivePlayerIt( (*dealerPositionIt)->getMyUniqueID() );
|
||||||
if(it != activePlayerList->end() ) {
|
if(it != activePlayerList->end() ) {
|
||||||
nextDealerFound = true;
|
nextDealerFound = true;
|
||||||
dealerPosition = (*it)->getMyUniqueID();
|
dealerPosition = (*it)->getMyUniqueID();
|
||||||
@@ -233,10 +233,10 @@ void Game::startHand()
|
|||||||
myGui->nextRoundCleanGui();
|
myGui->nextRoundCleanGui();
|
||||||
|
|
||||||
//Log new Hand
|
//Log new Hand
|
||||||
myGui->logNewGameHandMsg(myGameID, actualHandID);
|
myGui->logNewGameHandMsg(myGameID, currentHandID);
|
||||||
myGui->flushLogAtGame(myGameID);
|
myGui->flushLogAtGame(myGameID);
|
||||||
|
|
||||||
actualHand->start();
|
currentHand->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::shared_ptr<PlayerInterface> Game::getPlayerByUniqueId(unsigned id)
|
boost::shared_ptr<PlayerInterface> Game::getPlayerByUniqueId(unsigned id)
|
||||||
@@ -275,9 +275,9 @@ void Game::raiseBlinds() {
|
|||||||
|
|
||||||
if (myGameData.raiseIntervalMode == RAISE_ON_HANDNUMBER) {
|
if (myGameData.raiseIntervalMode == RAISE_ON_HANDNUMBER) {
|
||||||
|
|
||||||
if (lastHandBlindsRaised + myGameData.raiseSmallBlindEveryHandsValue <= actualHandID) {
|
if (lastHandBlindsRaised + myGameData.raiseSmallBlindEveryHandsValue <= currentHandID) {
|
||||||
raiseBlinds = true;
|
raiseBlinds = true;
|
||||||
lastHandBlindsRaised = actualHandID;
|
lastHandBlindsRaised = currentHandID;
|
||||||
|
|
||||||
// cout << "raise now on hands \n";
|
// cout << "raise now on hands \n";
|
||||||
}
|
}
|
||||||
@@ -297,7 +297,7 @@ void Game::raiseBlinds() {
|
|||||||
// Now we check how the blinds should be raised
|
// Now we check how the blinds should be raised
|
||||||
|
|
||||||
if (myGameData.raiseMode == DOUBLE_BLINDS) {
|
if (myGameData.raiseMode == DOUBLE_BLINDS) {
|
||||||
actualSmallBlind *= 2;
|
currentSmallBlind *= 2;
|
||||||
// cout << "double small blind \n";
|
// cout << "double small blind \n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -307,17 +307,17 @@ void Game::raiseBlinds() {
|
|||||||
|
|
||||||
if(!blindsList.empty()) {
|
if(!blindsList.empty()) {
|
||||||
|
|
||||||
actualSmallBlind = blindsList.front();
|
currentSmallBlind = blindsList.front();
|
||||||
blindsList.pop_front();
|
blindsList.pop_front();
|
||||||
|
|
||||||
// it = find(blindsList.begin(), blindsList.end(), actualSmallBlind);
|
// it = find(blindsList.begin(), blindsList.end(), currentSmallBlind);
|
||||||
// if(it != blindsList.end()) {
|
// if(it != blindsList.end()) {
|
||||||
// it++;
|
// it++;
|
||||||
// cout << "increase position in blindslist \n";
|
// cout << "increase position in blindslist \n";
|
||||||
// }
|
// }
|
||||||
// else {
|
// else {
|
||||||
// cout << "blindslist exceeds\n";
|
// cout << "blindslist exceeds\n";
|
||||||
// if(actualSmallBlind == myGameData.firstSmallBlind) {
|
// if(currentSmallBlind == myGameData.firstSmallBlind) {
|
||||||
// it = blindsList.begin();
|
// it = blindsList.begin();
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
@@ -330,19 +330,19 @@ void Game::raiseBlinds() {
|
|||||||
|
|
||||||
// The position exceeds the list
|
// The position exceeds the list
|
||||||
if (myGameData.afterManualBlindsMode == AFTERMB_DOUBLE_BLINDS) {
|
if (myGameData.afterManualBlindsMode == AFTERMB_DOUBLE_BLINDS) {
|
||||||
actualSmallBlind *= 2;
|
currentSmallBlind *= 2;
|
||||||
// cout << "after blindslist double blind\n";
|
// cout << "after blindslist double blind\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(myGameData.afterManualBlindsMode == AFTERMB_RAISE_ABOUT) {
|
if(myGameData.afterManualBlindsMode == AFTERMB_RAISE_ABOUT) {
|
||||||
actualSmallBlind += myGameData.afterMBAlwaysRaiseValue;
|
currentSmallBlind += myGameData.afterMBAlwaysRaiseValue;
|
||||||
// cout << "after blindslist increase about x \n";
|
// cout << "after blindslist increase about x \n";
|
||||||
}
|
}
|
||||||
// else { /* Stay at last blind */ cout << "after blindslist stay at last blind \n"; }
|
// else { /* Stay at last blind */ cout << "after blindslist stay at last blind \n"; }
|
||||||
}
|
}
|
||||||
// } else {
|
// } else {
|
||||||
// Grab the blinds amount from the list
|
// Grab the blinds amount from the list
|
||||||
// actualSmallBlind = *it;
|
// currentSmallBlind = *it;
|
||||||
// cout << "set new small blind from blindslist \n";
|
// cout << "set new small blind from blindslist \n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-8
@@ -73,11 +73,11 @@ public:
|
|||||||
|
|
||||||
int getMyGameID() const { return myGameID; }
|
int getMyGameID() const { return myGameID; }
|
||||||
|
|
||||||
void setActualSmallBlind(int theValue) { actualSmallBlind = theValue; }
|
void setCurrentSmallBlind(int theValue) { currentSmallBlind = theValue; }
|
||||||
int getActualSmallBlind() const { return actualSmallBlind; }
|
int getCurrentSmallBlind() const { return currentSmallBlind; }
|
||||||
|
|
||||||
void setActualHandID(int theValue) { actualHandID = theValue; }
|
void setCurrentHandID(int theValue) { currentHandID = theValue; }
|
||||||
int getActualHandID() const { return actualHandID; }
|
int getCurrentHandID() const { return currentHandID; }
|
||||||
|
|
||||||
boost::shared_ptr<PlayerInterface> getPlayerByUniqueId(unsigned id);
|
boost::shared_ptr<PlayerInterface> getPlayerByUniqueId(unsigned id);
|
||||||
boost::shared_ptr<PlayerInterface> getCurrentPlayer();
|
boost::shared_ptr<PlayerInterface> getCurrentPlayer();
|
||||||
@@ -88,8 +88,8 @@ private:
|
|||||||
boost::shared_ptr<EngineFactory> myFactory;
|
boost::shared_ptr<EngineFactory> myFactory;
|
||||||
|
|
||||||
GuiInterface *myGui;
|
GuiInterface *myGui;
|
||||||
HandInterface *actualHand;
|
HandInterface *currentHand;
|
||||||
BoardInterface *actualBoard;
|
BoardInterface *currentBoard;
|
||||||
|
|
||||||
std::vector<boost::shared_ptr<PlayerInterface> > playerArray; // available seats --> seatList !!! TODO // delete
|
std::vector<boost::shared_ptr<PlayerInterface> > playerArray; // available seats --> seatList !!! TODO // delete
|
||||||
PlayerList seatsList;
|
PlayerList seatsList;
|
||||||
@@ -106,8 +106,8 @@ private:
|
|||||||
int guiPlayerNum;
|
int guiPlayerNum;
|
||||||
|
|
||||||
//Laufvariablen
|
//Laufvariablen
|
||||||
int actualSmallBlind;
|
int currentSmallBlind;
|
||||||
int actualHandID;
|
int currentHandID;
|
||||||
unsigned dealerPosition;
|
unsigned dealerPosition;
|
||||||
int lastHandBlindsRaised;
|
int lastHandBlindsRaised;
|
||||||
int lastTimeBlindsRaised;
|
int lastTimeBlindsRaised;
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
|
mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
|
||||||
: QMainWindow(parent), myChat(NULL), myConfig(c), gameSpeed(0), myActionIsBet(0), myActionIsRaise(0), pushButtonBetRaiseIsChecked(FALSE), pushButtonCallCheckIsChecked(FALSE), pushButtonFoldIsChecked(FALSE), pushButtonAllInIsChecked(FALSE), myButtonsAreCheckable(FALSE), breakAfterActualHand(FALSE)
|
: QMainWindow(parent), myChat(NULL), myConfig(c), gameSpeed(0), myActionIsBet(0), myActionIsRaise(0), pushButtonBetRaiseIsChecked(FALSE), pushButtonCallCheckIsChecked(FALSE), pushButtonFoldIsChecked(FALSE), pushButtonAllInIsChecked(FALSE), myButtonsAreCheckable(FALSE), breakAfterCurrentHand(FALSE)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -2120,7 +2120,7 @@ void mainWindowImpl::provideMyActions() {
|
|||||||
horizontalSlider_bet->setEnabled(TRUE);
|
horizontalSlider_bet->setEnabled(TRUE);
|
||||||
spinBox_set->setEnabled(TRUE);
|
spinBox_set->setEnabled(TRUE);
|
||||||
|
|
||||||
switch (currentHand->getActualRound()) {
|
switch (currentHand->getCurrentRound()) {
|
||||||
|
|
||||||
case 0: {
|
case 0: {
|
||||||
if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) {
|
if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) {
|
||||||
@@ -3432,7 +3432,7 @@ void mainWindowImpl::showMyCards() {
|
|||||||
HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand();
|
HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand();
|
||||||
|
|
||||||
currentHand->getSeatsList()->front()->getMyCards(tempCardsIntArray);
|
currentHand->getSeatsList()->front()->getMyCards(tempCardsIntArray);
|
||||||
if( currentHand->getSeatsList()->front()->getMyCardsFlip() == 0 && currentHand->getActualRound() == 4 && currentHand->getSeatsList()->front()->getMyActiveStatus() && currentHand->getSeatsList()->front()->getMyAction() != PLAYER_ACTION_FOLD) {
|
if( currentHand->getSeatsList()->front()->getMyCardsFlip() == 0 && currentHand->getCurrentRound() == 4 && currentHand->getSeatsList()->front()->getMyActiveStatus() && currentHand->getSeatsList()->front()->getMyAction() != PLAYER_ACTION_FOLD) {
|
||||||
|
|
||||||
//set Player value (logging)
|
//set Player value (logging)
|
||||||
currentHand->getSeatsList()->front()->setMyCardsFlip(1,1);
|
currentHand->getSeatsList()->front()->setMyCardsFlip(1,1);
|
||||||
@@ -3442,7 +3442,7 @@ void mainWindowImpl::showMyCards() {
|
|||||||
|
|
||||||
void mainWindowImpl::startNewHand() {
|
void mainWindowImpl::startNewHand() {
|
||||||
|
|
||||||
if( !breakAfterActualHand){
|
if( !breakAfterCurrentHand){
|
||||||
mySession->getCurrentGame()->initHand();
|
mySession->getCurrentGame()->initHand();
|
||||||
mySession->getCurrentGame()->startHand();
|
mySession->getCurrentGame()->startHand();
|
||||||
}
|
}
|
||||||
@@ -3454,7 +3454,7 @@ void mainWindowImpl::startNewHand() {
|
|||||||
pushButton_break->setMinimumSize(width+10,20);
|
pushButton_break->setMinimumSize(width+10,20);
|
||||||
|
|
||||||
pushButton_break->setText(tr("Start"));
|
pushButton_break->setText(tr("Start"));
|
||||||
breakAfterActualHand=FALSE;
|
breakAfterCurrentHand=FALSE;
|
||||||
|
|
||||||
blinkingStartButtonAnimationTimer->start(500);
|
blinkingStartButtonAnimationTimer->start(500);
|
||||||
}
|
}
|
||||||
@@ -3508,7 +3508,7 @@ void mainWindowImpl::nextRoundCleanGui() {
|
|||||||
else {
|
else {
|
||||||
//FIX STRG+N Bug
|
//FIX STRG+N Bug
|
||||||
pushButton_break->setEnabled(TRUE);
|
pushButton_break->setEnabled(TRUE);
|
||||||
breakAfterActualHand=FALSE;
|
breakAfterCurrentHand=FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Clean breakbutton
|
//Clean breakbutton
|
||||||
@@ -3582,7 +3582,7 @@ void mainWindowImpl::breakButtonClicked() {
|
|||||||
|
|
||||||
if (pushButton_break->text() == tr("Stop")) {
|
if (pushButton_break->text() == tr("Stop")) {
|
||||||
pushButton_break->setDisabled(TRUE);
|
pushButton_break->setDisabled(TRUE);
|
||||||
breakAfterActualHand=TRUE;
|
breakAfterCurrentHand=TRUE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
blinkingStartButtonAnimationTimer->stop();
|
blinkingStartButtonAnimationTimer->stop();
|
||||||
|
|||||||
@@ -454,7 +454,7 @@ private:
|
|||||||
bool pushButtonAllInIsChecked;
|
bool pushButtonAllInIsChecked;
|
||||||
bool myButtonsAreCheckable;
|
bool myButtonsAreCheckable;
|
||||||
|
|
||||||
bool breakAfterActualHand;
|
bool breakAfterCurrentHand;
|
||||||
|
|
||||||
bool flipHolecardsAllInAlreadyDone;
|
bool flipHolecardsAllInAlreadyDone;
|
||||||
|
|
||||||
|
|||||||
@@ -967,10 +967,10 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
|||||||
throw ClientException(ERR_NET_UNKNOWN_PLAYER_ID, 0);
|
throw ClientException(ERR_NET_UNKNOWN_PLAYER_ID, 0);
|
||||||
|
|
||||||
// Set round.
|
// Set round.
|
||||||
if (curGame->getCurrentHand()->getActualRound() != turnData.gameState)
|
if (curGame->getCurrentHand()->getCurrentRound() != turnData.gameState)
|
||||||
{
|
{
|
||||||
ResetPlayerActions(*curGame);
|
ResetPlayerActions(*curGame);
|
||||||
curGame->getCurrentHand()->setActualRound(turnData.gameState);
|
curGame->getCurrentHand()->setCurrentRound(turnData.gameState);
|
||||||
// Refresh actions.
|
// Refresh actions.
|
||||||
client.GetGui().refreshSet();
|
client.GetGui().refreshSet();
|
||||||
client.GetGui().refreshAction();
|
client.GetGui().refreshAction();
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ ClientThread::SendPlayerAction()
|
|||||||
boost::shared_ptr<NetPacket> action(new NetPacketPlayersAction);
|
boost::shared_ptr<NetPacket> action(new NetPacketPlayersAction);
|
||||||
NetPacketPlayersAction::Data actionData;
|
NetPacketPlayersAction::Data actionData;
|
||||||
boost::shared_ptr<PlayerInterface> myPlayer = GetGame()->getSeatsList()->front();
|
boost::shared_ptr<PlayerInterface> myPlayer = GetGame()->getSeatsList()->front();
|
||||||
actionData.gameState = static_cast<GameState>(GetGame()->getCurrentHand()->getActualRound());
|
actionData.gameState = static_cast<GameState>(GetGame()->getCurrentHand()->getCurrentRound());
|
||||||
actionData.playerAction = static_cast<PlayerAction>(myPlayer->getMyAction());
|
actionData.playerAction = static_cast<PlayerAction>(myPlayer->getMyAction());
|
||||||
// Only send last bet if not fold/checked.
|
// Only send last bet if not fold/checked.
|
||||||
if (actionData.playerAction != PLAYER_ACTION_FOLD && actionData.playerAction != PLAYER_ACTION_CHECK)
|
if (actionData.playerAction != PLAYER_ACTION_FOLD && actionData.playerAction != PLAYER_ACTION_CHECK)
|
||||||
|
|||||||
@@ -622,11 +622,11 @@ ServerGameStateStartRound::Process(ServerGameThread &server)
|
|||||||
Game &curGame = server.GetGame();
|
Game &curGame = server.GetGame();
|
||||||
|
|
||||||
// Main game loop.
|
// Main game loop.
|
||||||
int curRound = curGame.getCurrentHand()->getActualRound();
|
int curRound = curGame.getCurrentHand()->getCurrentRound();
|
||||||
curGame.getCurrentHand()->switchRounds();
|
curGame.getCurrentHand()->switchRounds();
|
||||||
if (!curGame.getCurrentHand()->getAllInCondition())
|
if (!curGame.getCurrentHand()->getAllInCondition())
|
||||||
curGame.getCurrentHand()->getCurrentBeRo()->run();
|
curGame.getCurrentHand()->getCurrentBeRo()->run();
|
||||||
int newRound = curGame.getCurrentHand()->getActualRound();
|
int newRound = curGame.getCurrentHand()->getCurrentRound();
|
||||||
|
|
||||||
// If round changes, deal cards if needed.
|
// If round changes, deal cards if needed.
|
||||||
if (newRound != curRound && newRound != GAME_STATE_POST_RIVER)
|
if (newRound != curRound && newRound != GAME_STATE_POST_RIVER)
|
||||||
@@ -690,7 +690,7 @@ ServerGameStateStartRound::Process(ServerGameThread &server)
|
|||||||
|
|
||||||
boost::shared_ptr<NetPacket> notification(new NetPacketPlayersTurn);
|
boost::shared_ptr<NetPacket> notification(new NetPacketPlayersTurn);
|
||||||
NetPacketPlayersTurn::Data playersTurnData;
|
NetPacketPlayersTurn::Data playersTurnData;
|
||||||
playersTurnData.gameState = (GameState)curGame.getCurrentHand()->getActualRound();
|
playersTurnData.gameState = (GameState)curGame.getCurrentHand()->getCurrentRound();
|
||||||
playersTurnData.playerId = curPlayer->getMyUniqueID();
|
playersTurnData.playerId = curPlayer->getMyUniqueID();
|
||||||
playersTurnData.minimumRaise = curGame.getCurrentHand()->getCurrentBeRo()->getMinimumRaise();
|
playersTurnData.minimumRaise = curGame.getCurrentHand()->getCurrentBeRo()->getMinimumRaise();
|
||||||
static_cast<NetPacketPlayersTurn *>(notification.get())->SetData(playersTurnData);
|
static_cast<NetPacketPlayersTurn *>(notification.get())->SetData(playersTurnData);
|
||||||
@@ -866,7 +866,7 @@ ServerGameStateWaitPlayerAction::InternalProcess(ServerGameThread &server, Sessi
|
|||||||
|
|
||||||
// Check whether this is the correct round.
|
// Check whether this is the correct round.
|
||||||
PlayerActionCode code = ACTION_CODE_VALID;
|
PlayerActionCode code = ACTION_CODE_VALID;
|
||||||
if (curGame.getCurrentHand()->getActualRound() != actionData.gameState)
|
if (curGame.getCurrentHand()->getCurrentRound() != actionData.gameState)
|
||||||
code = ACTION_CODE_INVALID_STATE;
|
code = ACTION_CODE_INVALID_STATE;
|
||||||
|
|
||||||
// Check whether this is the correct player.
|
// Check whether this is the correct player.
|
||||||
@@ -1029,7 +1029,7 @@ ServerGameStateDealCardsDelay::Process(ServerGameThread &server)
|
|||||||
int allInDelay = curGame.getCurrentHand()->getAllInCondition() ? SERVER_DEAL_ADD_ALL_IN_DELAY_SEC : 0;
|
int allInDelay = curGame.getCurrentHand()->getAllInCondition() ? SERVER_DEAL_ADD_ALL_IN_DELAY_SEC : 0;
|
||||||
int delay = 0;
|
int delay = 0;
|
||||||
|
|
||||||
switch(curGame.getCurrentHand()->getActualRound())
|
switch(curGame.getCurrentHand()->getCurrentRound())
|
||||||
{
|
{
|
||||||
case GAME_STATE_FLOP:
|
case GAME_STATE_FLOP:
|
||||||
delay = SERVER_DEAL_FLOP_CARDS_DELAY_SEC;
|
delay = SERVER_DEAL_FLOP_CARDS_DELAY_SEC;
|
||||||
@@ -1082,7 +1082,7 @@ ServerGameStateShowCardsDelay::Process(ServerGameThread &server)
|
|||||||
if (GetTimer().elapsed().total_seconds() >= SERVER_SHOW_CARDS_DELAY_SEC)
|
if (GetTimer().elapsed().total_seconds() >= SERVER_SHOW_CARDS_DELAY_SEC)
|
||||||
{
|
{
|
||||||
Game &curGame = server.GetGame();
|
Game &curGame = server.GetGame();
|
||||||
SendNewRoundCards(server, curGame, curGame.getCurrentHand()->getActualRound());
|
SendNewRoundCards(server, curGame, curGame.getCurrentHand()->getCurrentRound());
|
||||||
|
|
||||||
server.SetState(ServerGameStateDealCardsDelay::Instance());
|
server.SetState(ServerGameStateDealCardsDelay::Instance());
|
||||||
retVal = MSG_NET_GAME_SERVER_CARDS_DELAY;
|
retVal = MSG_NET_GAME_SERVER_CARDS_DELAY;
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ ServerGameThread::AddSession(SessionWrapper session)
|
|||||||
GameState
|
GameState
|
||||||
ServerGameThread::GetCurRound() const
|
ServerGameThread::GetCurRound() const
|
||||||
{
|
{
|
||||||
return static_cast<GameState>(GetGame().getCurrentHand()->getActualRound());
|
return static_cast<GameState>(GetGame().getCurrentHand()->getCurrentRound());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user