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:
lotodore
2007-06-11 17:48:22 +00:00
parent dfffa16565
commit 07dc39d107
30 changed files with 1128 additions and 225 deletions
+4 -4
View File
@@ -31,19 +31,19 @@ public:
~LocalFlop();
void setPlayersTurn(const int& theValue) { playersTurn = theValue; }
void setPlayersTurn(int theValue) { playersTurn = theValue; }
int getPlayersTurn() const { return playersTurn; }
void setHighestSet(const int& theValue) { highestSet = theValue; }
void setHighestSet(int theValue) { highestSet = theValue; }
int getHighestSet() const { return highestSet;}
void setFirstFlopRound(bool theValue) { firstFlopRound = theValue;}
bool getFirstFlopRound() const { return firstFlopRound;}
void setSmallBlindPosition(const int& theValue) { smallBlindPosition = theValue;}
void setSmallBlindPosition(int theValue) { smallBlindPosition = theValue;}
int getSmallBlindPosition() const { return smallBlindPosition; }
void setSmallBlind(const int& theValue) { smallBlind = theValue; }
void setSmallBlind(int theValue) { smallBlind = theValue; }
int getSmallBlind() const { return smallBlind; }
void resetFirstRun() { firstFlopRun = false; }
+7 -2
View File
@@ -70,16 +70,21 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
myBoard->setMyCards(tempBoardArray);
for(i=0; i<startQuantityPlayers; i++) {
if(playerArray[i]->getMyActiveStatus() != 0) {
int bestHandPos[5];
playerArray[i]->getMyBestHandPosition(bestHandPos);
for(j=0; j<2; j++) {
tempPlayerArray[j] = cardsArray[2*k+j+5];
tempPlayerAndBoardArray[j] = cardsArray[2*k+j+5];
}
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
for(j=0; j<5; j++) {
if((playerArray[i]->getMyBestHandPosition())[j] == -1) {
if (bestHandPos[j] == -1) {
cout << "ERROR get myBestHandPosition in localhand.cpp" << endl;
}
}
+11 -2
View File
@@ -78,7 +78,7 @@ public:
bool getMyActiveStatus() const { return myActiveStatus; }
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;}
bool getMyTurn() const{ return myTurn;}
@@ -103,7 +103,16 @@ public:
void setMyCardsValueInt(int theValue) { myCardsValueInt = theValue;}
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;}
int getMyRoundStartCash() const { return myRoundStartCash; }
+2 -2
View File
@@ -31,10 +31,10 @@ public:
~LocalPreflop();
void setPlayersTurn(const int& theValue) { playersTurn = theValue; }
void setPlayersTurn(int theValue) { playersTurn = theValue; }
int getPlayersTurn() const { return playersTurn; }
void setHighestSet(const int& theValue) { highestSet = theValue; }
void setHighestSet(int theValue) { highestSet = theValue; }
int getHighestSet() const { return highestSet;}
void setPreflopFirstRound(bool theValue) { preflopFirstRound = theValue; }
+5 -5
View File
@@ -30,22 +30,22 @@ public:
LocalRiver(HandInterface*, int, int, int, int);
~LocalRiver();
void setPlayersTurn(const int& theValue) { playersTurn = theValue; }
void setPlayersTurn(int theValue) { playersTurn = theValue; }
int getPlayersTurn() const { return playersTurn; }
void setHighestSet(const int& theValue) { highestSet = theValue; }
void setHighestSet(int theValue) { highestSet = theValue; }
int getHighestSet() const { return highestSet;}
void setFirstRiverRound(bool theValue) { firstRiverRound = theValue;}
bool getFirstRiverRound() const { return firstRiverRound;}
void setSmallBlindPosition(const int& theValue) { smallBlindPosition = theValue;}
void setSmallBlindPosition(int theValue) { smallBlindPosition = theValue;}
int getSmallBlindPosition() const { return smallBlindPosition; }
void setSmallBlind(const int& theValue) { smallBlind = theValue; }
void setSmallBlind(int theValue) { smallBlind = theValue; }
int getSmallBlind() const { return smallBlind; }
void setHighestCardsValue(const int& theValue) { highestCardsValue = theValue;}
void setHighestCardsValue(int theValue) { highestCardsValue = theValue;}
int getHighestCardsValue() const { return highestCardsValue;}
void resetFirstRun() { firstRiverRun = false; }
+4 -4
View File
@@ -29,19 +29,19 @@ public:
LocalTurn(HandInterface*, int, int, int, int);
~LocalTurn();
void setPlayersTurn(const int& theValue) { playersTurn = theValue; }
void setPlayersTurn(int theValue) { playersTurn = theValue; }
int getPlayersTurn() const { return playersTurn; }
void setHighestSet(const int& theValue) { highestSet = theValue; }
void setHighestSet(int theValue) { highestSet = theValue; }
int getHighestSet() const { return highestSet;}
void setFirstTurnRound(bool theValue) { firstTurnRound = theValue;}
bool getFirstTurnRound() const { return firstTurnRound;}
void setSmallBlindPosition(const int& theValue) { smallBlindPosition = theValue;}
void setSmallBlindPosition(int theValue) { smallBlindPosition = theValue;}
int getSmallBlindPosition() const { return smallBlindPosition; }
void setSmallBlind(const int& theValue) { smallBlind = theValue; }
void setSmallBlind(int theValue) { smallBlind = theValue; }
int getSmallBlind() const { return smallBlind; }
void resetFirstRun() { firstTurnRun = false; }