Client engine should now be completely thread safe. const int& -> int. Player CardsValue is now returned as copy, not the array itself.
This commit is contained in:
@@ -26,19 +26,19 @@ public:
|
|||||||
|
|
||||||
virtual ~FlopInterface();
|
virtual ~FlopInterface();
|
||||||
|
|
||||||
virtual void setPlayersTurn(const int& theValue) =0;
|
virtual void setPlayersTurn(int theValue) =0;
|
||||||
virtual int getPlayersTurn() const =0;
|
virtual int getPlayersTurn() const =0;
|
||||||
|
|
||||||
virtual void setHighestSet(const int& theValue) =0;
|
virtual void setHighestSet(int theValue) =0;
|
||||||
virtual int getHighestSet() const =0;
|
virtual int getHighestSet() const =0;
|
||||||
|
|
||||||
virtual void setFirstFlopRound(bool theValue) =0;
|
virtual void setFirstFlopRound(bool theValue) =0;
|
||||||
virtual bool getFirstFlopRound() const =0;
|
virtual bool getFirstFlopRound() const =0;
|
||||||
|
|
||||||
virtual void setSmallBlindPosition(const int& theValue) =0;
|
virtual void setSmallBlindPosition(int theValue) =0;
|
||||||
virtual int getSmallBlindPosition() const =0;
|
virtual int getSmallBlindPosition() const =0;
|
||||||
|
|
||||||
virtual void setSmallBlind(const int& theValue) =0;
|
virtual void setSmallBlind(int theValue) =0;
|
||||||
virtual int getSmallBlind() const =0;
|
virtual int getSmallBlind() const =0;
|
||||||
|
|
||||||
virtual void resetFirstRun() =0;
|
virtual void resetFirstRun() =0;
|
||||||
|
|||||||
@@ -31,19 +31,19 @@ public:
|
|||||||
~LocalFlop();
|
~LocalFlop();
|
||||||
|
|
||||||
|
|
||||||
void setPlayersTurn(const int& theValue) { playersTurn = theValue; }
|
void setPlayersTurn(int theValue) { playersTurn = theValue; }
|
||||||
int getPlayersTurn() const { return playersTurn; }
|
int getPlayersTurn() const { return playersTurn; }
|
||||||
|
|
||||||
void setHighestSet(const int& theValue) { highestSet = theValue; }
|
void setHighestSet(int theValue) { highestSet = theValue; }
|
||||||
int getHighestSet() const { return highestSet;}
|
int getHighestSet() const { return highestSet;}
|
||||||
|
|
||||||
void setFirstFlopRound(bool theValue) { firstFlopRound = theValue;}
|
void setFirstFlopRound(bool theValue) { firstFlopRound = theValue;}
|
||||||
bool getFirstFlopRound() const { return firstFlopRound;}
|
bool getFirstFlopRound() const { return firstFlopRound;}
|
||||||
|
|
||||||
void setSmallBlindPosition(const int& theValue) { smallBlindPosition = theValue;}
|
void setSmallBlindPosition(int theValue) { smallBlindPosition = theValue;}
|
||||||
int getSmallBlindPosition() const { return smallBlindPosition; }
|
int getSmallBlindPosition() const { return smallBlindPosition; }
|
||||||
|
|
||||||
void setSmallBlind(const int& theValue) { smallBlind = theValue; }
|
void setSmallBlind(int theValue) { smallBlind = theValue; }
|
||||||
int getSmallBlind() const { return smallBlind; }
|
int getSmallBlind() const { return smallBlind; }
|
||||||
|
|
||||||
void resetFirstRun() { firstFlopRun = false; }
|
void resetFirstRun() { firstFlopRun = false; }
|
||||||
|
|||||||
@@ -70,16 +70,21 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
|
|||||||
myBoard->setMyCards(tempBoardArray);
|
myBoard->setMyCards(tempBoardArray);
|
||||||
for(i=0; i<startQuantityPlayers; i++) {
|
for(i=0; i<startQuantityPlayers; i++) {
|
||||||
if(playerArray[i]->getMyActiveStatus() != 0) {
|
if(playerArray[i]->getMyActiveStatus() != 0) {
|
||||||
|
|
||||||
|
int bestHandPos[5];
|
||||||
|
playerArray[i]->getMyBestHandPosition(bestHandPos);
|
||||||
|
|
||||||
for(j=0; j<2; j++) {
|
for(j=0; j<2; j++) {
|
||||||
tempPlayerArray[j] = cardsArray[2*k+j+5];
|
tempPlayerArray[j] = cardsArray[2*k+j+5];
|
||||||
tempPlayerAndBoardArray[j] = cardsArray[2*k+j+5];
|
tempPlayerAndBoardArray[j] = cardsArray[2*k+j+5];
|
||||||
}
|
}
|
||||||
playerArray[i]->setMyCards(tempPlayerArray);
|
playerArray[i]->setMyCards(tempPlayerArray);
|
||||||
playerArray[i]->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,playerArray[i]->getMyBestHandPosition()));
|
playerArray[i]->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray, bestHandPos));
|
||||||
|
playerArray[i]->setMyBestHandPosition(bestHandPos);
|
||||||
|
|
||||||
// myBestHandPosition auf Fehler ueberpruefen
|
// myBestHandPosition auf Fehler ueberpruefen
|
||||||
for(j=0; j<5; j++) {
|
for(j=0; j<5; j++) {
|
||||||
if((playerArray[i]->getMyBestHandPosition())[j] == -1) {
|
if (bestHandPos[j] == -1) {
|
||||||
cout << "ERROR get myBestHandPosition in localhand.cpp" << endl;
|
cout << "ERROR get myBestHandPosition in localhand.cpp" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public:
|
|||||||
bool getMyActiveStatus() const { return myActiveStatus; }
|
bool getMyActiveStatus() const { return myActiveStatus; }
|
||||||
|
|
||||||
void setMyCards(int* theValue) { int i; for(i=0; i<2; i++) myCards[i] = theValue[i]; }
|
void setMyCards(int* theValue) { int i; for(i=0; i<2; i++) myCards[i] = theValue[i]; }
|
||||||
void getMyCards(int* theValue) { int i; for(i=0; i<2; i++) theValue[i] = myCards[i]; }
|
void getMyCards(int* theValue) const { int i; for(i=0; i<2; i++) theValue[i] = myCards[i]; }
|
||||||
|
|
||||||
void setMyTurn(bool theValue){ myTurn = theValue;}
|
void setMyTurn(bool theValue){ myTurn = theValue;}
|
||||||
bool getMyTurn() const{ return myTurn;}
|
bool getMyTurn() const{ return myTurn;}
|
||||||
@@ -103,7 +103,16 @@ public:
|
|||||||
void setMyCardsValueInt(int theValue) { myCardsValueInt = theValue;}
|
void setMyCardsValueInt(int theValue) { myCardsValueInt = theValue;}
|
||||||
int getMyCardsValueInt() const { return myCardsValueInt; }
|
int getMyCardsValueInt() const { return myCardsValueInt; }
|
||||||
|
|
||||||
int* getMyBestHandPosition() { return myBestHandPosition; }
|
void setMyBestHandPosition(int* theValue)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 5; i++)
|
||||||
|
myBestHandPosition[i] = theValue[i];
|
||||||
|
}
|
||||||
|
void getMyBestHandPosition(int* theValue) const
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 5; i++)
|
||||||
|
theValue[i] = myBestHandPosition[i];
|
||||||
|
}
|
||||||
|
|
||||||
void setMyRoundStartCash(int theValue) { myRoundStartCash = theValue;}
|
void setMyRoundStartCash(int theValue) { myRoundStartCash = theValue;}
|
||||||
int getMyRoundStartCash() const { return myRoundStartCash; }
|
int getMyRoundStartCash() const { return myRoundStartCash; }
|
||||||
|
|||||||
@@ -31,10 +31,10 @@ public:
|
|||||||
~LocalPreflop();
|
~LocalPreflop();
|
||||||
|
|
||||||
|
|
||||||
void setPlayersTurn(const int& theValue) { playersTurn = theValue; }
|
void setPlayersTurn(int theValue) { playersTurn = theValue; }
|
||||||
int getPlayersTurn() const { return playersTurn; }
|
int getPlayersTurn() const { return playersTurn; }
|
||||||
|
|
||||||
void setHighestSet(const int& theValue) { highestSet = theValue; }
|
void setHighestSet(int theValue) { highestSet = theValue; }
|
||||||
int getHighestSet() const { return highestSet;}
|
int getHighestSet() const { return highestSet;}
|
||||||
|
|
||||||
void setPreflopFirstRound(bool theValue) { preflopFirstRound = theValue; }
|
void setPreflopFirstRound(bool theValue) { preflopFirstRound = theValue; }
|
||||||
|
|||||||
@@ -30,22 +30,22 @@ public:
|
|||||||
LocalRiver(HandInterface*, int, int, int, int);
|
LocalRiver(HandInterface*, int, int, int, int);
|
||||||
~LocalRiver();
|
~LocalRiver();
|
||||||
|
|
||||||
void setPlayersTurn(const int& theValue) { playersTurn = theValue; }
|
void setPlayersTurn(int theValue) { playersTurn = theValue; }
|
||||||
int getPlayersTurn() const { return playersTurn; }
|
int getPlayersTurn() const { return playersTurn; }
|
||||||
|
|
||||||
void setHighestSet(const int& theValue) { highestSet = theValue; }
|
void setHighestSet(int theValue) { highestSet = theValue; }
|
||||||
int getHighestSet() const { return highestSet;}
|
int getHighestSet() const { return highestSet;}
|
||||||
|
|
||||||
void setFirstRiverRound(bool theValue) { firstRiverRound = theValue;}
|
void setFirstRiverRound(bool theValue) { firstRiverRound = theValue;}
|
||||||
bool getFirstRiverRound() const { return firstRiverRound;}
|
bool getFirstRiverRound() const { return firstRiverRound;}
|
||||||
|
|
||||||
void setSmallBlindPosition(const int& theValue) { smallBlindPosition = theValue;}
|
void setSmallBlindPosition(int theValue) { smallBlindPosition = theValue;}
|
||||||
int getSmallBlindPosition() const { return smallBlindPosition; }
|
int getSmallBlindPosition() const { return smallBlindPosition; }
|
||||||
|
|
||||||
void setSmallBlind(const int& theValue) { smallBlind = theValue; }
|
void setSmallBlind(int theValue) { smallBlind = theValue; }
|
||||||
int getSmallBlind() const { return smallBlind; }
|
int getSmallBlind() const { return smallBlind; }
|
||||||
|
|
||||||
void setHighestCardsValue(const int& theValue) { highestCardsValue = theValue;}
|
void setHighestCardsValue(int theValue) { highestCardsValue = theValue;}
|
||||||
int getHighestCardsValue() const { return highestCardsValue;}
|
int getHighestCardsValue() const { return highestCardsValue;}
|
||||||
|
|
||||||
void resetFirstRun() { firstRiverRun = false; }
|
void resetFirstRun() { firstRiverRun = false; }
|
||||||
|
|||||||
@@ -29,19 +29,19 @@ public:
|
|||||||
LocalTurn(HandInterface*, int, int, int, int);
|
LocalTurn(HandInterface*, int, int, int, int);
|
||||||
~LocalTurn();
|
~LocalTurn();
|
||||||
|
|
||||||
void setPlayersTurn(const int& theValue) { playersTurn = theValue; }
|
void setPlayersTurn(int theValue) { playersTurn = theValue; }
|
||||||
int getPlayersTurn() const { return playersTurn; }
|
int getPlayersTurn() const { return playersTurn; }
|
||||||
|
|
||||||
void setHighestSet(const int& theValue) { highestSet = theValue; }
|
void setHighestSet(int theValue) { highestSet = theValue; }
|
||||||
int getHighestSet() const { return highestSet;}
|
int getHighestSet() const { return highestSet;}
|
||||||
|
|
||||||
void setFirstTurnRound(bool theValue) { firstTurnRound = theValue;}
|
void setFirstTurnRound(bool theValue) { firstTurnRound = theValue;}
|
||||||
bool getFirstTurnRound() const { return firstTurnRound;}
|
bool getFirstTurnRound() const { return firstTurnRound;}
|
||||||
|
|
||||||
void setSmallBlindPosition(const int& theValue) { smallBlindPosition = theValue;}
|
void setSmallBlindPosition(int theValue) { smallBlindPosition = theValue;}
|
||||||
int getSmallBlindPosition() const { return smallBlindPosition; }
|
int getSmallBlindPosition() const { return smallBlindPosition; }
|
||||||
|
|
||||||
void setSmallBlind(const int& theValue) { smallBlind = theValue; }
|
void setSmallBlind(int theValue) { smallBlind = theValue; }
|
||||||
int getSmallBlind() const { return smallBlind; }
|
int getSmallBlind() const { return smallBlind; }
|
||||||
|
|
||||||
void resetFirstRun() { firstTurnRun = false; }
|
void resetFirstRun() { firstTurnRun = false; }
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#include "clientboard.h"
|
#include "clientboard.h"
|
||||||
|
|
||||||
#include "localhand.h"
|
#include <handinterface.h>
|
||||||
#include <game_defs.h>
|
#include <game_defs.h>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@@ -36,26 +36,74 @@ ClientBoard::~ClientBoard()
|
|||||||
void
|
void
|
||||||
ClientBoard::setPlayer(PlayerInterface** p)
|
ClientBoard::setPlayer(PlayerInterface** p)
|
||||||
{
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
playerArray = p;
|
playerArray = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ClientBoard::setHand(HandInterface* br)
|
ClientBoard::setHand(HandInterface* br)
|
||||||
{
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
actualHand = br;
|
actualHand = br;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientBoard::setMyCards(int* theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
for (int i = 0; i < 5; i++)
|
||||||
|
myCards[i] = theValue[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientBoard::getMyCards(int* theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
for (int i = 0; i < 5; i++)
|
||||||
|
theValue[i] = myCards[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientBoard::getPot() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return pot;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientBoard::setPot(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
pot = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientBoard::getSets() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return sets;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientBoard::setSets(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
sets = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ClientBoard::collectSets()
|
ClientBoard::collectSets()
|
||||||
{
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
sets = 0;
|
sets = 0;
|
||||||
int i;
|
for (int i = 0; i < MAX_NUMBER_OF_PLAYERS; i++)
|
||||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) sets += playerArray[i]->getMySet();
|
sets += playerArray[i]->getMySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ClientBoard::collectPot()
|
ClientBoard::collectPot()
|
||||||
{
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
pot += sets;
|
pot += sets;
|
||||||
sets = 0;
|
sets = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,12 +20,14 @@
|
|||||||
#define CLIENTBOARD_H
|
#define CLIENTBOARD_H
|
||||||
|
|
||||||
#include <boardinterface.h>
|
#include <boardinterface.h>
|
||||||
|
#include <boost/thread.hpp>
|
||||||
|
|
||||||
class PlayerInterface;
|
class PlayerInterface;
|
||||||
class HandInterface;
|
class HandInterface;
|
||||||
|
|
||||||
|
|
||||||
class ClientBoard : public BoardInterface{
|
class ClientBoard : public BoardInterface
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
ClientBoard();
|
ClientBoard();
|
||||||
~ClientBoard();
|
~ClientBoard();
|
||||||
@@ -33,18 +35,20 @@ public:
|
|||||||
void setPlayer(PlayerInterface**);
|
void setPlayer(PlayerInterface**);
|
||||||
void setHand(HandInterface*);
|
void setHand(HandInterface*);
|
||||||
|
|
||||||
void setMyCards(int* theValue) { int i; for(i=0; i<5; i++) myCards[i] = theValue[i]; }
|
void setMyCards(int* theValue);
|
||||||
void getMyCards(int* theValue) { int i; for(i=0; i<5; i++) theValue[i] = myCards[i]; }
|
void getMyCards(int* theValue);
|
||||||
|
|
||||||
int getPot() const { return pot;}
|
int getPot() const;
|
||||||
void setPot(int theValue) { pot = theValue;}
|
void setPot(int theValue);
|
||||||
int getSets() const { return sets; }
|
int getSets() const;
|
||||||
void setSets(int theValue) { sets = theValue; }
|
void setSets(int theValue);
|
||||||
|
|
||||||
void collectSets();
|
void collectSets();
|
||||||
void collectPot();
|
void collectPot();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
mutable boost::recursive_mutex m_syncMutex;
|
||||||
|
|
||||||
PlayerInterface **playerArray;
|
PlayerInterface **playerArray;
|
||||||
HandInterface *actualHand;
|
HandInterface *actualHand;
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,83 @@ ClientFlop::~ClientFlop()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientFlop::setPlayersTurn(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
playersTurn = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientFlop::getPlayersTurn() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return playersTurn;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientFlop::setHighestSet(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
highestSet = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientFlop::getHighestSet() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return highestSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientFlop::setFirstFlopRound(bool theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
firstFlopRound = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ClientFlop::getFirstFlopRound() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return firstFlopRound;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientFlop::setSmallBlindPosition(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
smallBlindPosition = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientFlop::getSmallBlindPosition() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return smallBlindPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientFlop::setSmallBlind(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
smallBlind = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientFlop::getSmallBlind() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return smallBlind;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientFlop::resetFirstRun()
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
firstFlopRun = false;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ClientFlop::flopRun()
|
ClientFlop::flopRun()
|
||||||
{
|
{
|
||||||
@@ -42,4 +119,3 @@ ClientFlop::nextPlayer2()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,36 +20,39 @@
|
|||||||
#define CLIENTFLOP_H
|
#define CLIENTFLOP_H
|
||||||
|
|
||||||
#include "flopinterface.h"
|
#include "flopinterface.h"
|
||||||
|
#include <boost/thread.hpp>
|
||||||
|
|
||||||
class HandInterface;
|
class HandInterface;
|
||||||
|
|
||||||
class ClientFlop : public FlopInterface{
|
class ClientFlop : public FlopInterface
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
ClientFlop(HandInterface*, int, int, int, int);
|
ClientFlop(HandInterface*, int, int, int, int);
|
||||||
~ClientFlop();
|
~ClientFlop();
|
||||||
|
|
||||||
|
|
||||||
void setPlayersTurn(const int& theValue) { playersTurn = theValue; }
|
void setPlayersTurn(int theValue);
|
||||||
int getPlayersTurn() const { return playersTurn; }
|
int getPlayersTurn() const;
|
||||||
|
|
||||||
void setHighestSet(const int& theValue) { highestSet = theValue; }
|
void setHighestSet(int theValue);
|
||||||
int getHighestSet() const { return highestSet;}
|
int getHighestSet() const;
|
||||||
|
|
||||||
void setFirstFlopRound(bool theValue) { firstFlopRound = theValue;}
|
void setFirstFlopRound(bool theValue);
|
||||||
bool getFirstFlopRound() const { return firstFlopRound;}
|
bool getFirstFlopRound() const;
|
||||||
|
|
||||||
void setSmallBlindPosition(const int& theValue) { smallBlindPosition = theValue;}
|
void setSmallBlindPosition(int theValue);
|
||||||
int getSmallBlindPosition() const { return smallBlindPosition; }
|
int getSmallBlindPosition() const;
|
||||||
|
|
||||||
void setSmallBlind(const int& theValue) { smallBlind = theValue; }
|
void setSmallBlind(int theValue);
|
||||||
int getSmallBlind() const { return smallBlind; }
|
int getSmallBlind() const;
|
||||||
|
|
||||||
void resetFirstRun() { firstFlopRun = false; }
|
void resetFirstRun();
|
||||||
|
|
||||||
void flopRun();
|
void flopRun();
|
||||||
void nextPlayer2();
|
void nextPlayer2();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
mutable boost::recursive_mutex m_syncMutex;
|
||||||
|
|
||||||
HandInterface *myHand;
|
HandInterface *myHand;
|
||||||
|
|
||||||
|
|||||||
@@ -74,9 +74,220 @@ ClientHand::start()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PlayerInterface**
|
||||||
|
ClientHand::getPlayerArray() const
|
||||||
|
{
|
||||||
|
return playerArray;
|
||||||
|
}
|
||||||
|
|
||||||
|
BoardInterface*
|
||||||
|
ClientHand::getBoard() const
|
||||||
|
{
|
||||||
|
return myBoard;
|
||||||
|
}
|
||||||
|
|
||||||
|
PreflopInterface*
|
||||||
|
ClientHand::getPreflop() const
|
||||||
|
{
|
||||||
|
return myPreflop;
|
||||||
|
}
|
||||||
|
|
||||||
|
FlopInterface*
|
||||||
|
ClientHand::getFlop() const
|
||||||
|
{
|
||||||
|
return myFlop;
|
||||||
|
}
|
||||||
|
|
||||||
|
TurnInterface*
|
||||||
|
ClientHand::getTurn() const
|
||||||
|
{
|
||||||
|
return myTurn;
|
||||||
|
}
|
||||||
|
|
||||||
|
RiverInterface*
|
||||||
|
ClientHand::getRiver() const
|
||||||
|
{
|
||||||
|
return myRiver;
|
||||||
|
}
|
||||||
|
|
||||||
|
GuiInterface*
|
||||||
|
ClientHand::getGuiInterface() const
|
||||||
|
{
|
||||||
|
return myGui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientHand::setMyID(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
myID = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientHand::getMyID() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return myID;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientHand::setActualQuantityPlayers(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
actualQuantityPlayers = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientHand::getActualQuantityPlayers() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return actualQuantityPlayers;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientHand::setStartQuantityPlayers(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
startQuantityPlayers = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientHand::getStartQuantityPlayers() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return startQuantityPlayers;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientHand::setActualRound(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
actualRound = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientHand::getActualRound() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return actualRound;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientHand::setDealerPosition(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
dealerPosition = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientHand::getDealerPosition() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return dealerPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientHand::setSmallBlind(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
smallBlind = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientHand::getSmallBlind() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return smallBlind;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientHand::setAllInCondition(bool theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
allInCondition = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ClientHand::getAllInCondition() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return allInCondition;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientHand::setStartCash(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
startCash = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientHand::getStartCash() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return startCash;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientHand::setActivePlayersCounter(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
activePlayersCounter = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientHand::getActivePlayersCounter() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return activePlayersCounter;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientHand::setBettingRoundsPlayed(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
bettingRoundsPlayed = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientHand::getBettingRoundsPlayed() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return bettingRoundsPlayed;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientHand::setLastPlayersTurn(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
lastPlayersTurn = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientHand::getLastPlayersTurn() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return lastPlayersTurn;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientHand::setCardsShown(bool theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
cardsShown = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ClientHand::getCardsShown() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return cardsShown;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ClientHand::switchRounds()
|
ClientHand::switchRounds()
|
||||||
{
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
// update active players counter.
|
// update active players counter.
|
||||||
activePlayersCounter = 0;
|
activePlayersCounter = 0;
|
||||||
for (int i = 0; i < MAX_NUMBER_OF_PLAYERS; i++) {
|
for (int i = 0; i < MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
@@ -84,5 +295,3 @@ ClientHand::switchRounds()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
#include <turninterface.h>
|
#include <turninterface.h>
|
||||||
#include <riverinterface.h>
|
#include <riverinterface.h>
|
||||||
|
|
||||||
|
#include <boost/thread.hpp>
|
||||||
|
|
||||||
class ClientHand : public HandInterface
|
class ClientHand : public HandInterface
|
||||||
{
|
{
|
||||||
@@ -38,54 +39,55 @@ public:
|
|||||||
|
|
||||||
void start();
|
void start();
|
||||||
|
|
||||||
PlayerInterface** getPlayerArray() const { return playerArray; }
|
PlayerInterface** getPlayerArray() const;
|
||||||
BoardInterface* getBoard() const { return myBoard; }
|
BoardInterface* getBoard() const;
|
||||||
PreflopInterface* getPreflop() const { return myPreflop; }
|
PreflopInterface* getPreflop() const;
|
||||||
FlopInterface* getFlop() const { return myFlop; }
|
FlopInterface* getFlop() const;
|
||||||
TurnInterface* getTurn() const { return myTurn; }
|
TurnInterface* getTurn() const;
|
||||||
RiverInterface* getRiver() const { return myRiver; }
|
RiverInterface* getRiver() const;
|
||||||
GuiInterface* getGuiInterface() const { return myGui; }
|
GuiInterface* getGuiInterface() const;
|
||||||
|
|
||||||
void setMyID(int theValue) { myID = theValue; }
|
void setMyID(int theValue);
|
||||||
int getMyID() const { return myID; }
|
int getMyID() const;
|
||||||
|
|
||||||
void setActualQuantityPlayers(int theValue) { actualQuantityPlayers = theValue; }
|
void setActualQuantityPlayers(int theValue);
|
||||||
int getActualQuantityPlayers() const { return actualQuantityPlayers; }
|
int getActualQuantityPlayers() const;
|
||||||
|
|
||||||
void setStartQuantityPlayers(int theValue) { startQuantityPlayers = theValue; }
|
void setStartQuantityPlayers(int theValue);
|
||||||
int getStartQuantityPlayers() const { return startQuantityPlayers; }
|
int getStartQuantityPlayers() const;
|
||||||
|
|
||||||
void setActualRound(int theValue) { actualRound = theValue; }
|
void setActualRound(int theValue);
|
||||||
int getActualRound() const { return actualRound; }
|
int getActualRound() const;
|
||||||
|
|
||||||
void setDealerPosition(int theValue) { dealerPosition = theValue; }
|
void setDealerPosition(int theValue);
|
||||||
int getDealerPosition() const { return dealerPosition; }
|
int getDealerPosition() const;
|
||||||
|
|
||||||
void setSmallBlind(int theValue) { smallBlind = theValue; }
|
void setSmallBlind(int theValue);
|
||||||
int getSmallBlind() const { return smallBlind; }
|
int getSmallBlind() const;
|
||||||
|
|
||||||
void setAllInCondition(bool theValue) { allInCondition = theValue; }
|
void setAllInCondition(bool theValue);
|
||||||
bool getAllInCondition() const { return allInCondition; }
|
bool getAllInCondition() const;
|
||||||
|
|
||||||
void setStartCash(int theValue) { startCash = theValue; }
|
void setStartCash(int theValue);
|
||||||
int getStartCash() const { return startCash; }
|
int getStartCash() const;
|
||||||
|
|
||||||
void setActivePlayersCounter(int theValue) { activePlayersCounter = theValue; }
|
void setActivePlayersCounter(int theValue);
|
||||||
int getActivePlayersCounter() const { return activePlayersCounter; }
|
int getActivePlayersCounter() const;
|
||||||
|
|
||||||
void setBettingRoundsPlayed(int theValue) { bettingRoundsPlayed = theValue; }
|
void setBettingRoundsPlayed(int theValue);
|
||||||
int getBettingRoundsPlayed() const { return bettingRoundsPlayed; }
|
int getBettingRoundsPlayed() const;
|
||||||
|
|
||||||
void setLastPlayersTurn(int theValue) { lastPlayersTurn = theValue; }
|
void setLastPlayersTurn(int theValue);
|
||||||
int getLastPlayersTurn() const { return lastPlayersTurn; }
|
int getLastPlayersTurn() const;
|
||||||
|
|
||||||
void setCardsShown(bool theValue) { cardsShown = theValue; }
|
void setCardsShown(bool theValue);
|
||||||
bool getCardsShown() const { return cardsShown; }
|
bool getCardsShown() const;
|
||||||
|
|
||||||
void switchRounds();
|
void switchRounds();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
mutable boost::recursive_mutex m_syncMutex;
|
||||||
|
|
||||||
boost::shared_ptr<EngineFactory> myFactory;
|
boost::shared_ptr<EngineFactory> myFactory;
|
||||||
GuiInterface *myGui;
|
GuiInterface *myGui;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#include "clientplayer.h"
|
#include "clientplayer.h"
|
||||||
#include "handinterface.h"
|
#include <handinterface.h>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@@ -36,9 +36,359 @@ ClientPlayer::~ClientPlayer()
|
|||||||
void
|
void
|
||||||
ClientPlayer::setHand(HandInterface* br)
|
ClientPlayer::setHand(HandInterface* br)
|
||||||
{
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
actualHand = br;
|
actualHand = br;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientPlayer::getMyID() const
|
||||||
|
{
|
||||||
|
return myID;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned
|
||||||
|
ClientPlayer::getMyUniqueID() const
|
||||||
|
{
|
||||||
|
return myUniqueID;
|
||||||
|
}
|
||||||
|
|
||||||
|
PlayerType
|
||||||
|
ClientPlayer::getMyType() const
|
||||||
|
{
|
||||||
|
return myType;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::setMyDude(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
myDude = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientPlayer::getMyDude() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return myDude;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::setMyDude4(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
myDude4 = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientPlayer::getMyDude4() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return myDude4;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::setMyName(const std::string& theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
myName = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string
|
||||||
|
ClientPlayer::getMyName() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return myName;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::setMyAvatar(const std::string& theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
myAvatar = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string
|
||||||
|
ClientPlayer::getMyAvatar() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return myAvatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::setMyCash(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
myCash = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientPlayer::getMyCash() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return myCash;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::setMySet(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
myLastRelativeSet = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::setMySetAbsolute(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
mySet = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::setMySetNull()
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
mySet = 0;
|
||||||
|
myLastRelativeSet = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientPlayer::getMySet() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return mySet;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientPlayer::getMyLastRelativeSet() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return myLastRelativeSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::setMyAction(int theValue, bool blind)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
myAction = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientPlayer::getMyAction() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return myAction;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::setMyButton(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
myButton = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientPlayer::getMyButton() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return myButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::setMyActiveStatus(bool theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
myActiveStatus = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ClientPlayer::getMyActiveStatus() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return myActiveStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::setMyCards(int* theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
for (int i = 0; i < 2; i++)
|
||||||
|
myCards[i] = theValue[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::getMyCards(int* theValue) const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
for (int i = 0; i < 2; i++)
|
||||||
|
theValue[i] = myCards[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::setMyTurn(bool theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
myTurn = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ClientPlayer::getMyTurn() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return myTurn;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::setMyCardsFlip(bool theValue, int state)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
myCardsFlip = theValue;
|
||||||
|
// log flipping cards
|
||||||
|
if (myCardsFlip) {
|
||||||
|
switch(state) {
|
||||||
|
case 1: actualHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt);
|
||||||
|
break;
|
||||||
|
case 2: actualHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1]);
|
||||||
|
break;
|
||||||
|
case 3: actualHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt, "has");
|
||||||
|
break;
|
||||||
|
default: ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ClientPlayer::getMyCardsFlip() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return myCardsFlip;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::setMyCardsValueInt(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
myCardsValueInt = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientPlayer::getMyCardsValueInt() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return myCardsValueInt;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::setMyBestHandPosition(int* theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
for (int i = 0; i < 5; i++)
|
||||||
|
myBestHandPosition[i] = theValue[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::getMyBestHandPosition(int* theValue) const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
for (int i = 0; i < 5; i++)
|
||||||
|
theValue[i] = myBestHandPosition[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::setMyRoundStartCash(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
myRoundStartCash = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientPlayer::getMyRoundStartCash() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return myRoundStartCash;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::setMyAverageSets(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
myAverageSets[0] = myAverageSets[1];
|
||||||
|
myAverageSets[1] = myAverageSets[2];
|
||||||
|
myAverageSets[2] = myAverageSets[3];
|
||||||
|
myAverageSets[3] = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientPlayer::getMyAverageSets() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return (myAverageSets[0]+myAverageSets[1]+myAverageSets[2]+myAverageSets[3])/4;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::setMyAggressive(bool theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
for (int i=0; i<6; i++)
|
||||||
|
{
|
||||||
|
myAggressive[i] = myAggressive[i+1];
|
||||||
|
}
|
||||||
|
myAggressive[6] = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientPlayer::getMyAggressive() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
int sum = 0;
|
||||||
|
for (int i=0; i<7; i++)
|
||||||
|
{
|
||||||
|
sum += myAggressive[i];
|
||||||
|
}
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::setSBluff(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
sBluff = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientPlayer::getSBluff() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return sBluff;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::setSBluffStatus(bool theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
sBluffStatus = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ClientPlayer::getSBluffStatus() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return sBluffStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPlayer::setMyWinnerState(bool theValue, int pot)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
myWinnerState = theValue;
|
||||||
|
if(theValue)
|
||||||
|
actualHand->getGuiInterface()->logPlayerWinsMsg(myID, pot);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ClientPlayer::getMyWinnerState() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return myWinnerState;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ClientPlayer::action()
|
ClientPlayer::action()
|
||||||
@@ -123,11 +473,13 @@ ClientPlayer::riverEngine3()
|
|||||||
|
|
||||||
void ClientPlayer::setNetSessionData(boost::shared_ptr<SessionData> session)
|
void ClientPlayer::setNetSessionData(boost::shared_ptr<SessionData> session)
|
||||||
{
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
myNetSessionData = session;
|
myNetSessionData = session;
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::shared_ptr<SessionData> ClientPlayer::getNetSessionData()
|
boost::shared_ptr<SessionData> ClientPlayer::getNetSessionData()
|
||||||
{
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
return myNetSessionData;
|
return myNetSessionData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,9 +22,9 @@
|
|||||||
#include <playerinterface.h>
|
#include <playerinterface.h>
|
||||||
|
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
|
#include <boost/thread.hpp>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
class CardsValue;
|
class CardsValue;
|
||||||
class ConfigFile;
|
class ConfigFile;
|
||||||
class HandInterface;
|
class HandInterface;
|
||||||
@@ -37,100 +37,72 @@ public:
|
|||||||
|
|
||||||
void setHand(HandInterface*);
|
void setHand(HandInterface*);
|
||||||
|
|
||||||
int getMyID() const { return myID; }
|
int getMyID() const;
|
||||||
unsigned getMyUniqueID() const { return myUniqueID; }
|
unsigned getMyUniqueID() const;
|
||||||
PlayerType getMyType() const { return myType; }
|
PlayerType getMyType() const;
|
||||||
|
|
||||||
void setMyDude(int theValue) { myDude = theValue; }
|
void setMyDude(int theValue);
|
||||||
int getMyDude() const { return myDude; }
|
int getMyDude() const;
|
||||||
|
|
||||||
void setMyDude4(int theValue) { myDude4 = theValue; }
|
void setMyDude4(int theValue);
|
||||||
int getMyDude4() const { return myDude4; }
|
int getMyDude4() const;
|
||||||
|
|
||||||
void setMyName(const std::string& theValue) { myName = theValue; }
|
void setMyName(const std::string& theValue);
|
||||||
std::string getMyName() const { return myName; }
|
std::string getMyName() const;
|
||||||
|
|
||||||
void setMyAvatar(const std::string& theValue) { myAvatar = theValue; }
|
void setMyAvatar(const std::string& theValue);
|
||||||
std::string getMyAvatar() const { return myAvatar; }
|
std::string getMyAvatar() const;
|
||||||
|
|
||||||
void setMyCash(int theValue) { myCash = theValue; }
|
void setMyCash(int theValue);
|
||||||
int getMyCash() const { return myCash; }
|
int getMyCash() const;
|
||||||
|
|
||||||
void setMySet(int theValue) { myLastRelativeSet = theValue; }
|
void setMySet(int theValue);
|
||||||
void setMySetAbsolute(int theValue) { mySet = theValue; }
|
void setMySetAbsolute(int theValue);
|
||||||
void setMySetNull() { mySet = 0; myLastRelativeSet = 0; }
|
void setMySetNull();
|
||||||
int getMySet() const { return mySet;}
|
int getMySet() const;
|
||||||
int getMyLastRelativeSet() const { return myLastRelativeSet; }
|
int getMyLastRelativeSet() const;
|
||||||
|
|
||||||
void setMyAction(int theValue, bool blind) { myAction = theValue; }
|
void setMyAction(int theValue, bool blind);
|
||||||
int getMyAction() const { return myAction; }
|
int getMyAction() const;
|
||||||
|
|
||||||
void setMyButton(int theValue) { myButton = theValue; }
|
void setMyButton(int theValue);
|
||||||
int getMyButton() const { return myButton; }
|
int getMyButton() const;
|
||||||
|
|
||||||
void setMyActiveStatus(bool theValue) { myActiveStatus = theValue; }
|
void setMyActiveStatus(bool theValue);
|
||||||
bool getMyActiveStatus() const { return myActiveStatus; }
|
bool getMyActiveStatus() const;
|
||||||
|
|
||||||
void setMyCards(int* theValue) { int i; for(i=0; i<2; i++) myCards[i] = theValue[i]; }
|
void setMyCards(int* theValue);
|
||||||
void getMyCards(int* theValue) { int i; for(i=0; i<2; i++) theValue[i] = myCards[i]; }
|
void getMyCards(int* theValue) const;
|
||||||
|
|
||||||
void setMyTurn(bool theValue){ myTurn = theValue;}
|
void setMyTurn(bool theValue);
|
||||||
bool getMyTurn() const{ return myTurn;}
|
bool getMyTurn() const;
|
||||||
|
|
||||||
void setMyCardsFlip(bool theValue, int state){
|
void setMyCardsFlip(bool theValue, int state);
|
||||||
myCardsFlip = theValue;
|
bool getMyCardsFlip() const;
|
||||||
// log flipping cards
|
|
||||||
if(myCardsFlip) {
|
|
||||||
switch(state) {
|
|
||||||
case 1: actualHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt);
|
|
||||||
break;
|
|
||||||
case 2: actualHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1]);
|
|
||||||
break;
|
|
||||||
case 3: actualHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt, "has");
|
|
||||||
break;
|
|
||||||
default: ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
bool getMyCardsFlip() const{ return myCardsFlip;}
|
|
||||||
|
|
||||||
void setMyCardsValueInt(int theValue) { myCardsValueInt = theValue;}
|
void setMyCardsValueInt(int theValue);
|
||||||
int getMyCardsValueInt() const { return myCardsValueInt; }
|
int getMyCardsValueInt() const;
|
||||||
|
|
||||||
int* getMyBestHandPosition() { return myBestHandPosition; }
|
void setMyBestHandPosition(int* theValue);
|
||||||
|
void getMyBestHandPosition(int* theValue) const;
|
||||||
|
|
||||||
void setMyRoundStartCash(int theValue) { myRoundStartCash = theValue;}
|
void setMyRoundStartCash(int theValue);
|
||||||
int getMyRoundStartCash() const { return myRoundStartCash; }
|
int getMyRoundStartCash() const;
|
||||||
|
|
||||||
void setMyAverageSets(int theValue) { myAverageSets[0] = myAverageSets[1]; myAverageSets[1] = myAverageSets[2]; myAverageSets[2] = myAverageSets[3]; myAverageSets[3] = theValue; }
|
void setMyAverageSets(int theValue);
|
||||||
int getMyAverageSets() const { return (myAverageSets[0]+myAverageSets[1]+myAverageSets[2]+myAverageSets[3])/4; }
|
int getMyAverageSets() const;
|
||||||
|
|
||||||
void setMyAggressive(bool theValue) {
|
void setMyAggressive(bool theValue);
|
||||||
int i;
|
int getMyAggressive() const;
|
||||||
for(i=0; i<6; i++) {
|
|
||||||
myAggressive[i] = myAggressive[i+1];
|
|
||||||
}
|
|
||||||
myAggressive[6] = theValue;
|
|
||||||
}
|
|
||||||
int getMyAggressive() const {
|
|
||||||
int i, sum = 0;
|
|
||||||
for(i=0; i<7; i++) {
|
|
||||||
sum += myAggressive[i];
|
|
||||||
}
|
|
||||||
return sum;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setSBluff ( int theValue ) { sBluff = theValue; }
|
void setSBluff (int theValue);
|
||||||
int getSBluff() const { return sBluff; }
|
int getSBluff() const;
|
||||||
|
|
||||||
void setSBluffStatus ( bool theValue ) { sBluffStatus = theValue; }
|
void setSBluffStatus (bool theValue);
|
||||||
bool getSBluffStatus() const { return sBluffStatus; }
|
bool getSBluffStatus() const;
|
||||||
|
|
||||||
void setMyWinnerState ( bool theValue, int pot ) {
|
void setMyWinnerState (bool theValue, int pot);
|
||||||
myWinnerState = theValue;
|
bool getMyWinnerState() const;
|
||||||
if(theValue) actualHand->getGuiInterface()->logPlayerWinsMsg(myID, pot);
|
|
||||||
}
|
|
||||||
bool getMyWinnerState() const { return myWinnerState;}
|
|
||||||
|
|
||||||
void action();
|
void action();
|
||||||
|
|
||||||
@@ -156,6 +128,7 @@ public:
|
|||||||
boost::shared_ptr<SessionData> getNetSessionData();
|
boost::shared_ptr<SessionData> getNetSessionData();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
mutable boost::recursive_mutex m_syncMutex;
|
||||||
|
|
||||||
ConfigFile *myConfig;
|
ConfigFile *myConfig;
|
||||||
HandInterface *actualHand;
|
HandInterface *actualHand;
|
||||||
@@ -164,9 +137,9 @@ private:
|
|||||||
CardsValue *myCardsValue;
|
CardsValue *myCardsValue;
|
||||||
|
|
||||||
// Konstanten
|
// Konstanten
|
||||||
int myID;
|
const int myID;
|
||||||
unsigned myUniqueID;
|
const unsigned myUniqueID;
|
||||||
PlayerType myType;
|
const PlayerType myType;
|
||||||
std::string myName;
|
std::string myName;
|
||||||
std::string myAvatar;
|
std::string myAvatar;
|
||||||
int myDude;
|
int myDude;
|
||||||
|
|||||||
@@ -34,6 +34,48 @@ ClientPreflop::~ClientPreflop()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPreflop::setPlayersTurn(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
playersTurn = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientPreflop::getPlayersTurn() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return playersTurn;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPreflop::setHighestSet(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
highestSet = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientPreflop::getHighestSet() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return highestSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientPreflop::setPreflopFirstRound(bool theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
preflopFirstRound = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ClientPreflop::setPreflopFirstRound() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return preflopFirstRound;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ClientPreflop::preflopRun()
|
ClientPreflop::preflopRun()
|
||||||
{
|
{
|
||||||
@@ -43,3 +85,4 @@ void
|
|||||||
ClientPreflop::nextPlayer2()
|
ClientPreflop::nextPlayer2()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#define CLIENTPREFLOP_H
|
#define CLIENTPREFLOP_H
|
||||||
|
|
||||||
#include <preflopinterface.h>
|
#include <preflopinterface.h>
|
||||||
|
#include <boost/thread.hpp>
|
||||||
|
|
||||||
class HandInterface;
|
class HandInterface;
|
||||||
|
|
||||||
@@ -29,22 +30,21 @@ public:
|
|||||||
ClientPreflop(HandInterface*, int, int, int, int);
|
ClientPreflop(HandInterface*, int, int, int, int);
|
||||||
~ClientPreflop();
|
~ClientPreflop();
|
||||||
|
|
||||||
|
void setPlayersTurn(int theValue);
|
||||||
|
int getPlayersTurn() const;
|
||||||
|
|
||||||
void setPlayersTurn(const int& theValue) { playersTurn = theValue; }
|
void setHighestSet(int theValue);
|
||||||
int getPlayersTurn() const { return playersTurn; }
|
int getHighestSet() const;
|
||||||
|
|
||||||
void setHighestSet(const int& theValue) { highestSet = theValue; }
|
void setPreflopFirstRound(bool theValue);
|
||||||
int getHighestSet() const { return highestSet;}
|
bool setPreflopFirstRound() const;
|
||||||
|
|
||||||
void setPreflopFirstRound(bool theValue) { preflopFirstRound = theValue; }
|
|
||||||
bool setPreflopFirstRound() const { return preflopFirstRound; }
|
|
||||||
|
|
||||||
void preflopRun();
|
void preflopRun();
|
||||||
void nextPlayer2();
|
void nextPlayer2();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
mutable boost::recursive_mutex m_syncMutex;
|
||||||
|
|
||||||
HandInterface *myHand;
|
HandInterface *myHand;
|
||||||
|
|
||||||
int myID;
|
int myID;
|
||||||
|
|||||||
@@ -31,6 +31,96 @@ ClientRiver::~ClientRiver()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientRiver::setPlayersTurn(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
playersTurn = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientRiver::getPlayersTurn() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return playersTurn;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientRiver::setHighestSet(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
highestSet = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientRiver::getHighestSet() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return highestSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientRiver::setFirstRiverRound(bool theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
firstRiverRound = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ClientRiver::getFirstRiverRound() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return firstRiverRound;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientRiver::setSmallBlindPosition(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
smallBlindPosition = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientRiver::getSmallBlindPosition() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return smallBlindPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientRiver::setSmallBlind(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
smallBlind = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientRiver::getSmallBlind() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return smallBlind;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientRiver::setHighestCardsValue(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
highestCardsValue = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientRiver::getHighestCardsValue() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return highestCardsValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientRiver::resetFirstRun()
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
firstRiverRun = false;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ClientRiver::riverRun()
|
ClientRiver::riverRun()
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#define CLIENTRIVER_H
|
#define CLIENTRIVER_H
|
||||||
|
|
||||||
#include <riverinterface.h>
|
#include <riverinterface.h>
|
||||||
|
#include <boost/thread.hpp>
|
||||||
|
|
||||||
class HandInterface;
|
class HandInterface;
|
||||||
|
|
||||||
@@ -29,25 +30,25 @@ public:
|
|||||||
ClientRiver(HandInterface*, int, int, int, int);
|
ClientRiver(HandInterface*, int, int, int, int);
|
||||||
~ClientRiver();
|
~ClientRiver();
|
||||||
|
|
||||||
void setPlayersTurn(const int& theValue) { playersTurn = theValue; }
|
void setPlayersTurn(int theValue);
|
||||||
int getPlayersTurn() const { return playersTurn; }
|
int getPlayersTurn() const;
|
||||||
|
|
||||||
void setHighestSet(const int& theValue) { highestSet = theValue; }
|
void setHighestSet(int theValue);
|
||||||
int getHighestSet() const { return highestSet;}
|
int getHighestSet() const;
|
||||||
|
|
||||||
void setFirstRiverRound(bool theValue) { firstRiverRound = theValue;}
|
void setFirstRiverRound(bool theValue);
|
||||||
bool getFirstRiverRound() const { return firstRiverRound;}
|
bool getFirstRiverRound() const;
|
||||||
|
|
||||||
void setSmallBlindPosition(const int& theValue) { smallBlindPosition = theValue;}
|
void setSmallBlindPosition(int theValue);
|
||||||
int getSmallBlindPosition() const { return smallBlindPosition; }
|
int getSmallBlindPosition() const;
|
||||||
|
|
||||||
void setSmallBlind(const int& theValue) { smallBlind = theValue; }
|
void setSmallBlind(int theValue);
|
||||||
int getSmallBlind() const { return smallBlind; }
|
int getSmallBlind() const;
|
||||||
|
|
||||||
void setHighestCardsValue(const int& theValue) { highestCardsValue = theValue;}
|
void setHighestCardsValue(int theValue);
|
||||||
int getHighestCardsValue() const { return highestCardsValue;}
|
int getHighestCardsValue() const;
|
||||||
|
|
||||||
void resetFirstRun() { firstRiverRun = false; }
|
void resetFirstRun();
|
||||||
|
|
||||||
void riverRun();
|
void riverRun();
|
||||||
void postRiverRun();
|
void postRiverRun();
|
||||||
@@ -55,6 +56,7 @@ public:
|
|||||||
void distributePot();
|
void distributePot();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
mutable boost::recursive_mutex m_syncMutex;
|
||||||
|
|
||||||
HandInterface *myHand;
|
HandInterface *myHand;
|
||||||
|
|
||||||
@@ -75,3 +77,4 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,83 @@ ClientTurn::~ClientTurn()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientTurn::setPlayersTurn(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
playersTurn = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientTurn::getPlayersTurn() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return playersTurn;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientTurn::setHighestSet(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
highestSet = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientTurn::getHighestSet() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return highestSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientTurn::setFirstTurnRound(bool theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
firstTurnRound = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ClientTurn::getFirstTurnRound() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return firstTurnRound;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientTurn::setSmallBlindPosition(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
smallBlindPosition = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientTurn::getSmallBlindPosition() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return smallBlindPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientTurn::setSmallBlind(int theValue)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
smallBlind = theValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ClientTurn::getSmallBlind() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return smallBlind;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientTurn::resetFirstRun()
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
firstTurnRun = false;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ClientTurn::turnRun()
|
ClientTurn::turnRun()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#define CLIENTTURN_H
|
#define CLIENTTURN_H
|
||||||
|
|
||||||
#include <turninterface.h>
|
#include <turninterface.h>
|
||||||
|
#include <boost/thread.hpp>
|
||||||
|
|
||||||
class HandInterface;
|
class HandInterface;
|
||||||
|
|
||||||
@@ -28,27 +29,28 @@ public:
|
|||||||
ClientTurn(HandInterface*, int, int, int, int);
|
ClientTurn(HandInterface*, int, int, int, int);
|
||||||
~ClientTurn();
|
~ClientTurn();
|
||||||
|
|
||||||
void setPlayersTurn(const int& theValue) { playersTurn = theValue; }
|
void setPlayersTurn(int theValue);
|
||||||
int getPlayersTurn() const { return playersTurn; }
|
int getPlayersTurn() const;
|
||||||
|
|
||||||
void setHighestSet(const int& theValue) { highestSet = theValue; }
|
void setHighestSet(int theValue);
|
||||||
int getHighestSet() const { return highestSet;}
|
int getHighestSet() const;
|
||||||
|
|
||||||
void setFirstTurnRound(bool theValue) { firstTurnRound = theValue;}
|
void setFirstTurnRound(bool theValue);
|
||||||
bool getFirstTurnRound() const { return firstTurnRound;}
|
bool getFirstTurnRound() const;
|
||||||
|
|
||||||
void setSmallBlindPosition(const int& theValue) { smallBlindPosition = theValue;}
|
void setSmallBlindPosition(int theValue);
|
||||||
int getSmallBlindPosition() const { return smallBlindPosition; }
|
int getSmallBlindPosition() const;
|
||||||
|
|
||||||
void setSmallBlind(const int& theValue) { smallBlind = theValue; }
|
void setSmallBlind(int theValue);
|
||||||
int getSmallBlind() const { return smallBlind; }
|
int getSmallBlind() const;
|
||||||
|
|
||||||
void resetFirstRun() { firstTurnRun = false; }
|
void resetFirstRun();
|
||||||
|
|
||||||
void turnRun();
|
void turnRun();
|
||||||
void nextPlayer2();
|
void nextPlayer2();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
mutable boost::recursive_mutex m_syncMutex;
|
||||||
|
|
||||||
HandInterface *myHand;
|
HandInterface *myHand;
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public:
|
|||||||
virtual bool getMyActiveStatus() const =0;
|
virtual bool getMyActiveStatus() const =0;
|
||||||
|
|
||||||
virtual void setMyCards(int* theValue) =0;
|
virtual void setMyCards(int* theValue) =0;
|
||||||
virtual void getMyCards(int* theValue) =0;
|
virtual void getMyCards(int* theValue) const =0;
|
||||||
|
|
||||||
virtual void setMyTurn(bool theValue) =0;
|
virtual void setMyTurn(bool theValue) =0;
|
||||||
virtual bool getMyTurn() const =0;
|
virtual bool getMyTurn() const =0;
|
||||||
@@ -80,7 +80,8 @@ public:
|
|||||||
virtual void setMyCardsValueInt(int theValue) =0;
|
virtual void setMyCardsValueInt(int theValue) =0;
|
||||||
virtual int getMyCardsValueInt() const =0;
|
virtual int getMyCardsValueInt() const =0;
|
||||||
|
|
||||||
virtual int* getMyBestHandPosition() =0;
|
virtual void setMyBestHandPosition(int* theValue) =0;
|
||||||
|
virtual void getMyBestHandPosition(int* theValue) const =0;
|
||||||
|
|
||||||
virtual void setMyRoundStartCash(int theValue) =0;
|
virtual void setMyRoundStartCash(int theValue) =0;
|
||||||
virtual int getMyRoundStartCash() const =0;
|
virtual int getMyRoundStartCash() const =0;
|
||||||
|
|||||||
@@ -25,10 +25,10 @@ public:
|
|||||||
|
|
||||||
virtual ~PreflopInterface();
|
virtual ~PreflopInterface();
|
||||||
|
|
||||||
virtual void setPlayersTurn(const int& theValue) =0;
|
virtual void setPlayersTurn(int theValue) =0;
|
||||||
virtual int getPlayersTurn() const =0;
|
virtual int getPlayersTurn() const =0;
|
||||||
|
|
||||||
virtual void setHighestSet(const int& theValue) =0;
|
virtual void setHighestSet(int theValue) =0;
|
||||||
virtual int getHighestSet() const =0;
|
virtual int getHighestSet() const =0;
|
||||||
|
|
||||||
virtual void setPreflopFirstRound(bool theValue) =0;
|
virtual void setPreflopFirstRound(bool theValue) =0;
|
||||||
|
|||||||
@@ -25,22 +25,22 @@ public:
|
|||||||
|
|
||||||
virtual ~RiverInterface();
|
virtual ~RiverInterface();
|
||||||
|
|
||||||
virtual void setPlayersTurn(const int& theValue) =0;
|
virtual void setPlayersTurn(int theValue) =0;
|
||||||
virtual int getPlayersTurn() const =0;
|
virtual int getPlayersTurn() const =0;
|
||||||
|
|
||||||
virtual void setHighestSet(const int& theValue) =0;
|
virtual void setHighestSet(int theValue) =0;
|
||||||
virtual int getHighestSet() const =0;
|
virtual int getHighestSet() const =0;
|
||||||
|
|
||||||
virtual void setFirstRiverRound(bool theValue) =0;
|
virtual void setFirstRiverRound(bool theValue) =0;
|
||||||
virtual bool getFirstRiverRound() const =0;
|
virtual bool getFirstRiverRound() const =0;
|
||||||
|
|
||||||
virtual void setSmallBlindPosition(const int& theValue) =0;
|
virtual void setSmallBlindPosition(int theValue) =0;
|
||||||
virtual int getSmallBlindPosition() const =0;
|
virtual int getSmallBlindPosition() const =0;
|
||||||
|
|
||||||
virtual void setSmallBlind(const int& theValue) =0;
|
virtual void setSmallBlind(int theValue) =0;
|
||||||
virtual int getSmallBlind() const =0;
|
virtual int getSmallBlind() const =0;
|
||||||
|
|
||||||
virtual void setHighestCardsValue(const int& theValue) =0;
|
virtual void setHighestCardsValue(int theValue) =0;
|
||||||
virtual int getHighestCardsValue() const =0;
|
virtual int getHighestCardsValue() const =0;
|
||||||
|
|
||||||
virtual void resetFirstRun() =0;
|
virtual void resetFirstRun() =0;
|
||||||
|
|||||||
@@ -25,19 +25,19 @@ class TurnInterface{
|
|||||||
public:
|
public:
|
||||||
virtual ~TurnInterface();
|
virtual ~TurnInterface();
|
||||||
|
|
||||||
virtual void setPlayersTurn(const int& theValue) =0;
|
virtual void setPlayersTurn(int theValue) =0;
|
||||||
virtual int getPlayersTurn() const =0;
|
virtual int getPlayersTurn() const =0;
|
||||||
|
|
||||||
virtual void setHighestSet(const int& theValue) =0;
|
virtual void setHighestSet(int theValue) =0;
|
||||||
virtual int getHighestSet() const=0;
|
virtual int getHighestSet() const=0;
|
||||||
|
|
||||||
virtual void setFirstTurnRound(bool theValue) =0;
|
virtual void setFirstTurnRound(bool theValue) =0;
|
||||||
virtual bool getFirstTurnRound() const =0;
|
virtual bool getFirstTurnRound() const =0;
|
||||||
|
|
||||||
virtual void setSmallBlindPosition(const int& theValue) =0;
|
virtual void setSmallBlindPosition(int theValue) =0;
|
||||||
virtual int getSmallBlindPosition() const =0;
|
virtual int getSmallBlindPosition() const =0;
|
||||||
|
|
||||||
virtual void setSmallBlind(const int& theValue) =0;
|
virtual void setSmallBlind(int theValue) =0;
|
||||||
virtual int getSmallBlind() const =0;
|
virtual int getSmallBlind() const =0;
|
||||||
|
|
||||||
virtual void resetFirstRun() =0;
|
virtual void resetFirstRun() =0;
|
||||||
|
|||||||
+6
-6
@@ -52,25 +52,25 @@ public:
|
|||||||
PlayerInterface** getPlayerArray() {return playerArray;}
|
PlayerInterface** getPlayerArray() {return playerArray;}
|
||||||
|
|
||||||
//Zufgriff Startvariablen
|
//Zufgriff Startvariablen
|
||||||
void setStartQuantityPlayers(const int& theValue) { startQuantityPlayers = theValue; }
|
void setStartQuantityPlayers(int theValue) { startQuantityPlayers = theValue; }
|
||||||
int getStartQuantityPlayers() const { return startQuantityPlayers; }
|
int getStartQuantityPlayers() const { return startQuantityPlayers; }
|
||||||
|
|
||||||
void setStartSmallBlind(const int& theValue) { startSmallBlind = theValue; }
|
void setStartSmallBlind(int theValue) { startSmallBlind = theValue; }
|
||||||
int getStartSmallBlind() const { return startSmallBlind; }
|
int getStartSmallBlind() const { return startSmallBlind; }
|
||||||
|
|
||||||
void setStartCash(const int& theValue) { startCash = theValue; }
|
void setStartCash(int theValue) { startCash = theValue; }
|
||||||
int getStartCash() const { return startCash; }
|
int getStartCash() const { return startCash; }
|
||||||
|
|
||||||
int getMyGameID() const { return myGameID; }
|
int getMyGameID() const { return myGameID; }
|
||||||
|
|
||||||
//Zufgriff Laufvariablen
|
//Zufgriff Laufvariablen
|
||||||
void setActualQuantityPlayers(const int& theValue) { actualQuantityPlayers = theValue; }
|
void setActualQuantityPlayers(int theValue) { actualQuantityPlayers = theValue; }
|
||||||
int getActualQuantityPlayers() const { return actualQuantityPlayers; }
|
int getActualQuantityPlayers() const { return actualQuantityPlayers; }
|
||||||
|
|
||||||
void setActualSmallBlind(const int& theValue) { actualSmallBlind = theValue; }
|
void setActualSmallBlind(int theValue) { actualSmallBlind = theValue; }
|
||||||
int getActualSmallBlind() const { return actualSmallBlind; }
|
int getActualSmallBlind() const { return actualSmallBlind; }
|
||||||
|
|
||||||
void setActualHandID(const int& theValue) { actualHandID = theValue; }
|
void setActualHandID(int theValue) { actualHandID = theValue; }
|
||||||
int getActualHandID() const { return actualHandID; }
|
int getActualHandID() const { return actualHandID; }
|
||||||
|
|
||||||
PlayerInterface * getPlayerByUniqueId(unsigned id);
|
PlayerInterface * getPlayerByUniqueId(unsigned id);
|
||||||
|
|||||||
@@ -1957,48 +1957,50 @@ void mainWindowImpl::postRiverRunAnimation3() {
|
|||||||
if ( currentHand->getActivePlayersCounter() != 1 && myConfig->readConfigInt("ShowFadeOutCardsAnimation")) {
|
if ( currentHand->getActivePlayersCounter() != 1 && myConfig->readConfigInt("ShowFadeOutCardsAnimation")) {
|
||||||
|
|
||||||
int j;
|
int j;
|
||||||
|
int bestHandPos[5];
|
||||||
|
currentHand->getPlayerArray()[i]->getMyBestHandPosition(bestHandPos);
|
||||||
|
|
||||||
//index 0 testen --> Karte darf nicht im MyBestHand Position Array drin sein, es darf nicht nur ein Spieler Aktiv sein, die Config fordert die Animation
|
//index 0 testen --> Karte darf nicht im MyBestHand Position Array drin sein, es darf nicht nur ein Spieler Aktiv sein, die Config fordert die Animation
|
||||||
bool index0 = TRUE;
|
bool index0 = TRUE;
|
||||||
for(j=0; j<5; j++) {
|
for(j=0; j<5; j++) {
|
||||||
// cout << (currentHand->getPlayerArray()[i]->getMyBestHandPosition())[j] << endl;
|
// cout << (currentHand->getPlayerArray()[i]->getMyBestHandPosition())[j] << endl;
|
||||||
if ((currentHand->getPlayerArray()[i]->getMyBestHandPosition())[j] == 0 ) { index0 = FALSE; }
|
if (bestHandPos[j] == 0 ) { index0 = FALSE; }
|
||||||
}
|
}
|
||||||
if (index0) { holeCardsArray[i][0]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index0" << endl;*/}
|
if (index0) { holeCardsArray[i][0]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index0" << endl;*/}
|
||||||
//index 1 testen
|
//index 1 testen
|
||||||
bool index1 = TRUE;
|
bool index1 = TRUE;
|
||||||
for(j=0; j<5; j++) {
|
for(j=0; j<5; j++) {
|
||||||
if ((currentHand->getPlayerArray()[i]->getMyBestHandPosition())[j] == 1 ) { index1 = FALSE; }
|
if (bestHandPos[j] == 1 ) { index1 = FALSE; }
|
||||||
}
|
}
|
||||||
if (index1) { holeCardsArray[i][1]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index1" << endl;*/}
|
if (index1) { holeCardsArray[i][1]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index1" << endl;*/}
|
||||||
//index 2 testen
|
//index 2 testen
|
||||||
bool index2 = TRUE;
|
bool index2 = TRUE;
|
||||||
for(j=0; j<5; j++) {
|
for(j=0; j<5; j++) {
|
||||||
if ((currentHand->getPlayerArray()[i]->getMyBestHandPosition())[j] == 2 ) { index2 = FALSE; }
|
if (bestHandPos[j] == 2 ) { index2 = FALSE; }
|
||||||
}
|
}
|
||||||
if (index2) { boardCardsArray[0]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index2" << endl;*/}
|
if (index2) { boardCardsArray[0]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index2" << endl;*/}
|
||||||
//index 3 testen
|
//index 3 testen
|
||||||
bool index3 = TRUE;
|
bool index3 = TRUE;
|
||||||
for(j=0; j<5; j++) {
|
for(j=0; j<5; j++) {
|
||||||
if ((currentHand->getPlayerArray()[i]->getMyBestHandPosition())[j] == 3 ) { index3 = FALSE; }
|
if (bestHandPos[j] == 3 ) { index3 = FALSE; }
|
||||||
}
|
}
|
||||||
if (index3) { boardCardsArray[1]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index3" << endl;*/}
|
if (index3) { boardCardsArray[1]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index3" << endl;*/}
|
||||||
//index 4 testen
|
//index 4 testen
|
||||||
bool index4 = TRUE;
|
bool index4 = TRUE;
|
||||||
for(j=0; j<5; j++) {
|
for(j=0; j<5; j++) {
|
||||||
if ((currentHand->getPlayerArray()[i]->getMyBestHandPosition())[j] == 4 ) { index4 = FALSE; }
|
if (bestHandPos[j] == 4 ) { index4 = FALSE; }
|
||||||
}
|
}
|
||||||
if (index4) { boardCardsArray[2]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index4" << endl;*/}
|
if (index4) { boardCardsArray[2]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index4" << endl;*/}
|
||||||
//index 5 testen
|
//index 5 testen
|
||||||
bool index5 = TRUE;
|
bool index5 = TRUE;
|
||||||
for(j=0; j<5; j++) {
|
for(j=0; j<5; j++) {
|
||||||
if ((currentHand->getPlayerArray()[i]->getMyBestHandPosition())[j] == 5 ) { index5 = FALSE; }
|
if (bestHandPos[j] == 5 ) { index5 = FALSE; }
|
||||||
}
|
}
|
||||||
if (index5) { boardCardsArray[3]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index5" << endl;*/}
|
if (index5) { boardCardsArray[3]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index5" << endl;*/}
|
||||||
//index 6 testen
|
//index 6 testen
|
||||||
bool index6 = TRUE;
|
bool index6 = TRUE;
|
||||||
for(j=0; j<5; j++) {
|
for(j=0; j<5; j++) {
|
||||||
if ((currentHand->getPlayerArray()[i]->getMyBestHandPosition())[j] == 6 ) { index6 = FALSE; }
|
if (bestHandPos[j] == 6 ) { index6 = FALSE; }
|
||||||
}
|
}
|
||||||
if (index6) { boardCardsArray[4]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index6" << endl;*/}
|
if (index6) { boardCardsArray[4]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index6" << endl;*/}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -818,12 +818,14 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
|||||||
throw ClientException(ERR_NET_UNKNOWN_PLAYER_ID, 0);
|
throw ClientException(ERR_NET_UNKNOWN_PLAYER_ID, 0);
|
||||||
|
|
||||||
int tmpCards[2];
|
int tmpCards[2];
|
||||||
|
int bestHandPos[5];
|
||||||
tmpCards[0] = static_cast<int>((*i).cards[0]);
|
tmpCards[0] = static_cast<int>((*i).cards[0]);
|
||||||
tmpCards[1] = static_cast<int>((*i).cards[1]);
|
tmpCards[1] = static_cast<int>((*i).cards[1]);
|
||||||
tmpPlayer->setMyCards(tmpCards);
|
tmpPlayer->setMyCards(tmpCards);
|
||||||
for (int num = 0; num < 5; num++)
|
for (int num = 0; num < 5; num++)
|
||||||
tmpPlayer->getMyBestHandPosition()[num] = (*i).bestHandPos[num];
|
bestHandPos[num] = (*i).bestHandPos[num];
|
||||||
tmpPlayer->setMyCardsValueInt((*i).valueOfCards);
|
tmpPlayer->setMyCardsValueInt((*i).valueOfCards);
|
||||||
|
tmpPlayer->setMyBestHandPosition(bestHandPos);
|
||||||
if (tmpPlayer->getMyCardsValueInt() > highestValueOfCards)
|
if (tmpPlayer->getMyCardsValueInt() > highestValueOfCards)
|
||||||
highestValueOfCards = tmpPlayer->getMyCardsValueInt();
|
highestValueOfCards = tmpPlayer->getMyCardsValueInt();
|
||||||
tmpPlayer->setMyCash((*i).playerMoney);
|
tmpPlayer->setMyCash((*i).playerMoney);
|
||||||
|
|||||||
@@ -618,12 +618,14 @@ ServerRecvStateStartRound::Process(ServerRecvThread &server)
|
|||||||
tmpPlayerResult.playerId = (*i)->getMyUniqueID();
|
tmpPlayerResult.playerId = (*i)->getMyUniqueID();
|
||||||
|
|
||||||
int tmpCards[2];
|
int tmpCards[2];
|
||||||
|
int bestHandPos[5];
|
||||||
(*i)->getMyCards(tmpCards);
|
(*i)->getMyCards(tmpCards);
|
||||||
tmpPlayerResult.cards[0] = static_cast<u_int16_t>(tmpCards[0]);
|
tmpPlayerResult.cards[0] = static_cast<u_int16_t>(tmpCards[0]);
|
||||||
tmpPlayerResult.cards[1] = static_cast<u_int16_t>(tmpCards[1]);
|
tmpPlayerResult.cards[1] = static_cast<u_int16_t>(tmpCards[1]);
|
||||||
|
|
||||||
|
(*i)->getMyBestHandPosition(bestHandPos);
|
||||||
for (int num = 0; num < 5; num++)
|
for (int num = 0; num < 5; num++)
|
||||||
tmpPlayerResult.bestHandPos[num] = (*i)->getMyBestHandPosition()[num];
|
tmpPlayerResult.bestHandPos[num] = bestHandPos[num];
|
||||||
|
|
||||||
tmpPlayerResult.valueOfCards = (*i)->getMyCardsValueInt();
|
tmpPlayerResult.valueOfCards = (*i)->getMyCardsValueInt();
|
||||||
tmpPlayerResult.moneyWon = 0; // TODO
|
tmpPlayerResult.moneyWon = 0; // TODO
|
||||||
|
|||||||
+1
-1
@@ -55,7 +55,7 @@ public:
|
|||||||
|
|
||||||
void sendClientPlayerAction();
|
void sendClientPlayerAction();
|
||||||
|
|
||||||
void setCurrentGameID(const int& theValue) { currentGameID = theValue; }
|
void setCurrentGameID(int theValue) { currentGameID = theValue; }
|
||||||
int getCurrentGameID() const { return currentGameID; }
|
int getCurrentGameID() const { return currentGameID; }
|
||||||
|
|
||||||
void sendChatMessage(const std::string &message);
|
void sendChatMessage(const std::string &message);
|
||||||
|
|||||||
Reference in New Issue
Block a user