Fixed init gui in networking (is now thread safe). Fixed displaying of game/hand number for network games.

This commit is contained in:
lotodore
2007-06-03 13:36:24 +00:00
parent baad95427f
commit 1fcb0c80fd
13 changed files with 58 additions and 34 deletions
+7 -7
View File
@@ -25,7 +25,10 @@
using namespace std;
LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, PlayerInterface **p, int id, int sP, int aP, int dP, int sB,int sC)
: HandInterface(), myFactory(f), myGui(g), myBoard(b), playerArray(p), myPreflop(0), myFlop(0), myTurn(0), myRiver(0), myID(id), actualQuantityPlayers(aP), startQuantityPlayers(sP), dealerPosition(dP), actualRound(0), smallBlind(sB), startCash(sC), lastPlayersTurn(0), allInCondition(0), bettingRoundsPlayed(0)
: myFactory(f), myGui(g), myBoard(b), playerArray(p), myPreflop(0), myFlop(0), myTurn(0), myRiver(0),
myID(id), actualQuantityPlayers(aP), startQuantityPlayers(sP), dealerPosition(dP), actualRound(0),
smallBlind(sB), startCash(sC), activePlayersCounter(aP), lastPlayersTurn(0), allInCondition(0),
bettingRoundsPlayed(0)
{
int i, j, k;
@@ -39,6 +42,8 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
if(playerArray[i]->getMyActiveStatus() != 0) {
playerArray[i]->setHand(this);
}
// myFlipCards auf 0 setzen
playerArray[i]->setMyCardsFlip(0, 0);
}
@@ -89,11 +94,6 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
}
delete[] cardsArray;
// myFlipCards auf 0 setzen
for(i=0; i<startQuantityPlayers; i++) {
playerArray[i]->setMyCardsFlip(0, 0);
}
// // // !!!!!!!!!!!!!!!!!!!!!!!!!!!!! testing !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //
// // int *temp5Array;
@@ -353,7 +353,7 @@ void LocalHand::switchRounds() {
//unhighlight actual players groupbox
if(playerArray[lastPlayersTurn]->getMyActiveStatus() == 1) myGui->refreshGroupbox(lastPlayersTurn,1);
myGui->refreshGameLabels(actualRound);
myGui->refreshGameLabels();
// /*/*/*/*cout <<*/*/*/*/ "NextPlayerSpeed1 stop" << endl;
//
// cout << "NextPlayerSpeed2 start" << endl;
+10 -1
View File
@@ -22,7 +22,10 @@
using namespace std;
ClientHand::ClientHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, PlayerInterface **p, int id, int sP, int aP, int dP, int sB,int sC)
: myFactory(f), myGui(g), myBoard(b), playerArray(p), myPreflop(0), myFlop(0), myTurn(0), myRiver(0), myID(id), actualQuantityPlayers(aP), startQuantityPlayers(sP), dealerPosition(dP), actualRound(0), smallBlind(sB), startCash(sC), allInCondition(0), bettingRoundsPlayed(0)
: myFactory(f), myGui(g), myBoard(b), playerArray(p), myPreflop(0), myFlop(0), myTurn(0), myRiver(0),
myID(id), actualQuantityPlayers(aP), startQuantityPlayers(sP), dealerPosition(dP), actualRound(0),
smallBlind(sB), startCash(sC), activePlayersCounter(aP), lastPlayersTurn(0), allInCondition(0),
bettingRoundsPlayed(0)
{
int i;
lastPlayersTurn = 0;
@@ -34,6 +37,7 @@ ClientHand::ClientHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, Boar
if(playerArray[i]->getMyActiveStatus() != 0) {
playerArray[i]->setHand(this);
}
// myFlipCards auf 0 setzen
playerArray[i]->setMyCardsFlip(0, 0);
}
@@ -72,6 +76,11 @@ ClientHand::start()
void
ClientHand::switchRounds()
{
// update active players counter.
activePlayersCounter = 0;
for (int i = 0; i < MAX_NUMBER_OF_PLAYERS; i++) {
if (playerArray[i]->getMyAction() != 1 && playerArray[i]->getMyActiveStatus() == 1) activePlayersCounter++;
}
}