fixed dealer assignment when actualquantity players < 3
This commit is contained in:
+46
-15
@@ -142,22 +142,53 @@ void Log::logNewGameHandMsg(int gameID, int handID) {
|
||||
|
||||
stream << "<p><b>##### Game: "+QString::number(gameID,10)+" | Hand: "+QString::number(handID,10)+" #####</b></br>" << "\n";
|
||||
stream << "CASH: ";
|
||||
for(i=0; i<myW->getActualHand()->getActualQuantityPlayers(); i++) {
|
||||
|
||||
if(myW->getActualHand()->getPlayerArray()[i]->getMyButton() == 1) {
|
||||
if(i == myW->getActualHand()->getActualQuantityPlayers()-1) {
|
||||
stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+" (Dealer): "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash(),10)+"$";
|
||||
int k = 0;
|
||||
//Aktive Spieler zählen
|
||||
int activePlayersCounter = 0;
|
||||
for (k=0; k<myW->getMaxQuantityPlayers(); k++) {
|
||||
if (myW->getActualHand()->getPlayerArray()[k]->getMyActiveStatus() == 1) activePlayersCounter++;
|
||||
}
|
||||
if(activePlayersCounter > 2) {
|
||||
|
||||
for(i=0; i<myW->getActualHand()->getActualQuantityPlayers(); i++) {
|
||||
|
||||
if(myW->getActualHand()->getPlayerArray()[i]->getMyButton() == 1) {
|
||||
if(i == myW->getActualHand()->getActualQuantityPlayers()-1) {
|
||||
stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+" (Dealer): "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash(),10)+"$";
|
||||
}
|
||||
else {
|
||||
stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+" (Dealer): "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash(),10)+"$, ";
|
||||
}
|
||||
}
|
||||
else {
|
||||
stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+" (Dealer): "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash(),10)+"$, ";
|
||||
}
|
||||
if(i == myW->getActualHand()->getActualQuantityPlayers()-1) {
|
||||
stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+": "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash(),10)+"$";
|
||||
}
|
||||
else {
|
||||
stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+": "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash(),10)+"$, ";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(i == myW->getActualHand()->getActualQuantityPlayers()-1) {
|
||||
stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+": "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash(),10)+"$";
|
||||
}
|
||||
else {
|
||||
for(i=0; i<myW->getActualHand()->getActualQuantityPlayers(); i++) {
|
||||
|
||||
if(myW->getActualHand()->getPlayerArray()[i]->getMyButton() == 3) {
|
||||
if(i == myW->getActualHand()->getActualQuantityPlayers()-1) {
|
||||
stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+" (Dealer): "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash(),10)+"$";
|
||||
}
|
||||
else {
|
||||
stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+" (Dealer): "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash(),10)+"$, ";
|
||||
}
|
||||
}
|
||||
else {
|
||||
stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+": "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash(),10)+"$, ";
|
||||
if(i == myW->getActualHand()->getActualQuantityPlayers()-1) {
|
||||
stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+": "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash(),10)+"$";
|
||||
}
|
||||
else {
|
||||
stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+": "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash(),10)+"$, ";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -183,11 +214,13 @@ void Log::logNewGameHandMsg(int gameID, int handID) {
|
||||
default :;
|
||||
}
|
||||
}
|
||||
stream << "</p>\n";
|
||||
|
||||
stream << "</br></br><b>PREFLOP</b>";
|
||||
stream << "</br>\n";
|
||||
|
||||
myLogFile->close();
|
||||
|
||||
linesInFile = linesInFile+3;
|
||||
linesInFile = linesInFile+2;
|
||||
|
||||
}
|
||||
|
||||
@@ -201,12 +234,10 @@ void Log::logPlayerWinsMsg(int playerID) {
|
||||
QTextStream stream( myLogFile );
|
||||
for(i=0; i<=linesInFile; i++) { stream.readLine(); }
|
||||
|
||||
QString msg("<p><i>"+QString::fromStdString(myW->getActualHand()->getPlayerArray()[playerID]->getMyName())+" wins!!!</i></p>\n");
|
||||
QString msg("</br><i>"+QString::fromStdString(myW->getActualHand()->getPlayerArray()[playerID]->getMyName())+" wins!!!</i></p>\n");
|
||||
stream << msg;
|
||||
|
||||
myLogFile->close();
|
||||
|
||||
linesInFile++;
|
||||
linesInFile++;
|
||||
|
||||
}
|
||||
|
||||
@@ -605,13 +605,32 @@ void mainWindowImpl::refreshButton() {
|
||||
QPixmap onePix(":/graphics/graphics/1px.png");
|
||||
|
||||
int i;
|
||||
int k;
|
||||
//Aktive Spieler zählen
|
||||
int activePlayersCounter = 0;
|
||||
for (k=0; k<maxQuantityPlayers; k++) {
|
||||
if (actualHand->getPlayerArray()[k]->getMyActiveStatus() == 1) activePlayersCounter++;
|
||||
}
|
||||
|
||||
for (i=0; i<actualHand->getActualQuantityPlayers(); i++) {
|
||||
if (actualHand->getPlayerArray()[i]->getMyButton()==1) {
|
||||
buttonLabelArray[i]->setPixmap(dealerButton);
|
||||
}
|
||||
else {
|
||||
buttonLabelArray[i]->setPixmap(onePix);
|
||||
|
||||
if(activePlayersCounter > 2) {
|
||||
if (actualHand->getPlayerArray()[i]->getMyButton()==1) {
|
||||
buttonLabelArray[i]->setPixmap(dealerButton);
|
||||
}
|
||||
else {
|
||||
buttonLabelArray[i]->setPixmap(onePix);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (actualHand->getPlayerArray()[i]->getMyButton()==3) {
|
||||
buttonLabelArray[i]->setPixmap(dealerButton);
|
||||
}
|
||||
else {
|
||||
buttonLabelArray[i]->setPixmap(onePix);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user