First try: Transferring client action.

This commit is contained in:
lotodore
2007-05-23 22:31:56 +00:00
parent f9ad1b6b75
commit 2556f43340
21 changed files with 243 additions and 115 deletions
+13 -42
View File
@@ -43,7 +43,19 @@ ClientHand::ClientHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, Boar
playerArray[i]->setMyRoundStartCash(playerArray[i]->getMyCash());
}
assignButtons();
// remove all buttons
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { playerArray[i]->setMyButton(0); }
// assign dealer button
playerArray[dealerPosition]->setMyButton(1);
// the rest of the buttons are assigned later as received from the server.
// Preflop, Flop, Turn und River erstellen
myPreflop = myFactory->createPreflop(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
myFlop = myFactory->createFlop(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
myTurn = myFactory->createTurn(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
myRiver = myFactory->createRiver(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
}
@@ -57,47 +69,6 @@ ClientHand::start()
{
}
void
ClientHand::assignButtons()
{
int i;
//Aktive Spieler zählen
int activePlayersCounter = 0;
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
if (playerArray[i]->getMyActiveStatus() == 1) activePlayersCounter++;
}
// alle Buttons loeschen
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { playerArray[i]->setMyButton(0); }
// DealerButton zuweisen
playerArray[dealerPosition]->setMyButton(1);
// assign Small Blind next to dealer. ATTENTION: in heads up it is big blind
i = dealerPosition;
do {
i = (i+1)%(MAX_NUMBER_OF_PLAYERS);
if(playerArray[i]->getMyActiveStatus()) {
if(activePlayersCounter > 2) playerArray[i]->setMyButton(2); //small blind normal
else playerArray[i]->setMyButton(3); //big blind in heads up
}
} while(!(playerArray[i]->getMyActiveStatus()));
// assign big blind next to small blind. ATTENTION: in heads up it is small blind
do {
i = (i+1)%(MAX_NUMBER_OF_PLAYERS);
if(playerArray[i]->getMyActiveStatus()) {
if(activePlayersCounter > 2) playerArray[i]->setMyButton(3); //big blind normal
else playerArray[i]->setMyButton(2); //small blind in heads up
}
} while(!(playerArray[i]->getMyActiveStatus()));
}
void
ClientHand::switchRounds()
{