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
+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;
}
}