actualQuantityPlayers -><- startQuantityPlayers
This commit is contained in:
@@ -47,6 +47,9 @@ public:
|
|||||||
virtual void setActualQuantityPlayers(const int& theValue) =0;
|
virtual void setActualQuantityPlayers(const int& theValue) =0;
|
||||||
virtual int getActualQuantityPlayers() const =0;
|
virtual int getActualQuantityPlayers() const =0;
|
||||||
|
|
||||||
|
virtual void setStartQuantityPlayers(const int& theValue) =0;
|
||||||
|
virtual int getStartQuantityPlayers() const =0;
|
||||||
|
|
||||||
virtual void setActualRound(const int& theValue) =0;
|
virtual void setActualRound(const int& theValue) =0;
|
||||||
virtual int getActualRound() const =0;
|
virtual int getActualRound() const =0;
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, PlayerInterface **p, int id, int qP, int dP, int sB,int sC) : HandInterface(), myFactory(f), myGui(g), myBoard(b), playerArray(p), myPreflop(0), myFlop(0), myTurn(0), myRiver(0), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), actualRound(0), smallBlind(sB), startCash(sC), allInCondition(0)
|
LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, PlayerInterface **p, int id, int qP, int dP, int sB,int sC) : HandInterface(), myFactory(f), myGui(g), myBoard(b), playerArray(p), myPreflop(0), myFlop(0), myTurn(0), myRiver(0), myID(id), actualQuantityPlayers(qP), startQuantityPlayers(qP), dealerPosition(dP), actualRound(0), smallBlind(sB), startCash(sC), allInCondition(0)
|
||||||
{
|
{
|
||||||
|
|
||||||
int i, j;
|
int i, j;
|
||||||
@@ -31,7 +31,7 @@ LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, Playe
|
|||||||
myBoard->setHand(this);
|
myBoard->setHand(this);
|
||||||
|
|
||||||
|
|
||||||
for(i=0; i<actualQuantityPlayers; i++) playerArray[i]->setHand(this);
|
for(i=0; i<startQuantityPlayers; i++) playerArray[i]->setHand(this);
|
||||||
|
|
||||||
|
|
||||||
// roundStartCashArray fllen
|
// roundStartCashArray fllen
|
||||||
@@ -47,8 +47,8 @@ LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, Playe
|
|||||||
|
|
||||||
// Karten generieren und Board sowie Player zuweisen
|
// Karten generieren und Board sowie Player zuweisen
|
||||||
Tools myTool;
|
Tools myTool;
|
||||||
int *cardsArray = new int[2*actualQuantityPlayers+5];
|
int *cardsArray = new int[2*startQuantityPlayers+5];
|
||||||
myTool.getRandNumber(0, 51, 2*actualQuantityPlayers+5, cardsArray, 1);
|
myTool.getRandNumber(0, 51, 2*startQuantityPlayers+5, cardsArray, 1);
|
||||||
int tempBoardArray[5];
|
int tempBoardArray[5];
|
||||||
int tempPlayerArray[2];
|
int tempPlayerArray[2];
|
||||||
int tempPlayerAndBoardArray[7];
|
int tempPlayerAndBoardArray[7];
|
||||||
@@ -57,7 +57,7 @@ LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, Playe
|
|||||||
tempPlayerAndBoardArray[i+2] = cardsArray[i];
|
tempPlayerAndBoardArray[i+2] = cardsArray[i];
|
||||||
}
|
}
|
||||||
myBoard->setMyCards(tempBoardArray);
|
myBoard->setMyCards(tempBoardArray);
|
||||||
for(i=0; i<actualQuantityPlayers; i++) {
|
for(i=0; i<startQuantityPlayers; i++) {
|
||||||
for(j=0; j<2; j++) {
|
for(j=0; j<2; j++) {
|
||||||
tempPlayerArray[j] = cardsArray[2*i+j+5];
|
tempPlayerArray[j] = cardsArray[2*i+j+5];
|
||||||
tempPlayerAndBoardArray[j] = cardsArray[2*i+j+5];
|
tempPlayerAndBoardArray[j] = cardsArray[2*i+j+5];
|
||||||
@@ -76,15 +76,15 @@ LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, Playe
|
|||||||
myGui->dealHoleCards();
|
myGui->dealHoleCards();
|
||||||
|
|
||||||
// myFlipCards auf 0 setzen
|
// myFlipCards auf 0 setzen
|
||||||
for(i=0; i<actualQuantityPlayers; i++) {
|
for(i=0; i<startQuantityPlayers; i++) {
|
||||||
playerArray[i]->setMyCardsFlip(0);
|
playerArray[i]->setMyCardsFlip(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Preflop, Flop, Turn und River erstellen
|
// Preflop, Flop, Turn und River erstellen
|
||||||
myPreflop = myFactory->createPreflop(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
|
myPreflop = myFactory->createPreflop(this, myID, startQuantityPlayers, dealerPosition, smallBlind);
|
||||||
myFlop = myFactory->createFlop(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
|
myFlop = myFactory->createFlop(this, myID, startQuantityPlayers, dealerPosition, smallBlind);
|
||||||
myTurn = myFactory->createTurn(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
|
myTurn = myFactory->createTurn(this, myID, startQuantityPlayers, dealerPosition, smallBlind);
|
||||||
myRiver = myFactory->createRiver(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
|
myRiver = myFactory->createRiver(this, myID, startQuantityPlayers, dealerPosition, smallBlind);
|
||||||
|
|
||||||
//Rundenwechsel | beim ersten Durchlauf --> Preflop starten
|
//Rundenwechsel | beim ersten Durchlauf --> Preflop starten
|
||||||
myGui->nextPlayerAnimation();
|
myGui->nextPlayerAnimation();
|
||||||
|
|||||||
@@ -57,6 +57,9 @@ public:
|
|||||||
void setActualQuantityPlayers(const int& theValue) { actualQuantityPlayers = theValue; }
|
void setActualQuantityPlayers(const int& theValue) { actualQuantityPlayers = theValue; }
|
||||||
int getActualQuantityPlayers() const { return actualQuantityPlayers; }
|
int getActualQuantityPlayers() const { return actualQuantityPlayers; }
|
||||||
|
|
||||||
|
void setStartQuantityPlayers(const int& theValue) { startQuantityPlayers = theValue; }
|
||||||
|
int getStartQuantityPlayers() const { return startQuantityPlayers; }
|
||||||
|
|
||||||
void setActualRound(const int& theValue) { actualRound = theValue; }
|
void setActualRound(const int& theValue) { actualRound = theValue; }
|
||||||
int getActualRound() const { return actualRound; }
|
int getActualRound() const { return actualRound; }
|
||||||
|
|
||||||
@@ -101,6 +104,7 @@ private:
|
|||||||
|
|
||||||
int myID;
|
int myID;
|
||||||
int actualQuantityPlayers;
|
int actualQuantityPlayers;
|
||||||
|
int startQuantityPlayers;
|
||||||
int dealerPosition; // -1 -> neutral
|
int dealerPosition; // -1 -> neutral
|
||||||
int actualRound; //0 = preflop, 1 = flop, 2 = turn, 3 = river
|
int actualRound; //0 = preflop, 1 = flop, 2 = turn, 3 = river
|
||||||
int smallBlind;
|
int smallBlind;
|
||||||
|
|||||||
@@ -151,10 +151,10 @@ void Log::logNewGameHandMsg(int gameID, int handID) {
|
|||||||
}
|
}
|
||||||
if(activePlayersCounter > 2) {
|
if(activePlayersCounter > 2) {
|
||||||
|
|
||||||
for(i=0; i<myW->getActualHand()->getActualQuantityPlayers(); i++) {
|
for(i=0; i<myW->getActualHand()->getStartQuantityPlayers(); i++) {
|
||||||
|
|
||||||
if(myW->getActualHand()->getPlayerArray()[i]->getMyButton() == 1) {
|
if(myW->getActualHand()->getPlayerArray()[i]->getMyButton() == 1) {
|
||||||
if(i == myW->getActualHand()->getActualQuantityPlayers()-1) {
|
if(i == myW->getActualHand()->getStartQuantityPlayers()-1) {
|
||||||
stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+" (Dealer): "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash(),10)+"$";
|
stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+" (Dealer): "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash(),10)+"$";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -162,7 +162,7 @@ void Log::logNewGameHandMsg(int gameID, int handID) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(i == myW->getActualHand()->getActualQuantityPlayers()-1) {
|
if(i == myW->getActualHand()->getStartQuantityPlayers()-1) {
|
||||||
stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+": "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash()+myW->getActualHand()->getPlayerArray()[i]->getMySet(),10)+"$";
|
stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+": "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash()+myW->getActualHand()->getPlayerArray()[i]->getMySet(),10)+"$";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -172,10 +172,10 @@ void Log::logNewGameHandMsg(int gameID, int handID) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for(i=0; i<myW->getActualHand()->getActualQuantityPlayers(); i++) {
|
for(i=0; i<myW->getActualHand()->getStartQuantityPlayers(); i++) {
|
||||||
|
|
||||||
if(myW->getActualHand()->getPlayerArray()[i]->getMyButton() == 3) {
|
if(myW->getActualHand()->getPlayerArray()[i]->getMyButton() == 3) {
|
||||||
if(i == myW->getActualHand()->getActualQuantityPlayers()-1) {
|
if(i == myW->getActualHand()->getStartQuantityPlayers()-1) {
|
||||||
stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+" (Dealer): "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash(),10)+"$";
|
stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+" (Dealer): "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash(),10)+"$";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -183,7 +183,7 @@ void Log::logNewGameHandMsg(int gameID, int handID) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(i == myW->getActualHand()->getActualQuantityPlayers()-1) {
|
if(i == myW->getActualHand()->getStartQuantityPlayers()-1) {
|
||||||
stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+": "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash()+myW->getActualHand()->getPlayerArray()[i]->getMySet(),10)+"$";
|
stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+": "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash()+myW->getActualHand()->getPlayerArray()[i]->getMySet(),10)+"$";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -732,7 +732,7 @@ void mainWindowImpl::refreshButton() {
|
|||||||
if (actualHand->getPlayerArray()[k]->getMyActiveStatus() == 1) activePlayersCounter++;
|
if (actualHand->getPlayerArray()[k]->getMyActiveStatus() == 1) activePlayersCounter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=0; i<actualHand->getActualQuantityPlayers(); i++) {
|
for (i=0; i<actualHand->getStartQuantityPlayers(); i++) {
|
||||||
|
|
||||||
if(activePlayersCounter > 2) {
|
if(activePlayersCounter > 2) {
|
||||||
if (actualHand->getPlayerArray()[i]->getMyButton()==1) {
|
if (actualHand->getPlayerArray()[i]->getMyButton()==1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user