First try: Transferring client action.
This commit is contained in:
@@ -39,6 +39,7 @@ public:
|
||||
int getPot() const { return pot;}
|
||||
void setPot(int theValue) { pot = theValue;}
|
||||
int getSets() const { return sets; }
|
||||
void setSets(int theValue) { sets = theValue; }
|
||||
|
||||
void collectSets();
|
||||
void collectPot();
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
` * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
@@ -30,7 +30,8 @@
|
||||
#include <riverinterface.h>
|
||||
|
||||
|
||||
class ClientHand : public HandInterface{
|
||||
class ClientHand : public HandInterface
|
||||
{
|
||||
public:
|
||||
ClientHand(boost::shared_ptr<EngineFactory> f, GuiInterface*, BoardInterface*, PlayerInterface**, int, int, int, int, int, int);
|
||||
~ClientHand();
|
||||
@@ -79,8 +80,6 @@ public:
|
||||
int getLastPlayersTurn() const { return lastPlayersTurn; }
|
||||
|
||||
|
||||
void assignButtons();
|
||||
|
||||
void highlightRoundLabel();
|
||||
void switchRounds();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user