actualQuantityPlayers -><- startQuantityPlayers (part 3)
This commit is contained in:
@@ -24,14 +24,18 @@ using namespace std;
|
|||||||
LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, PlayerInterface **p, int id, int sP, int aP, 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(aP), startQuantityPlayers(sP), dealerPosition(dP), actualRound(0), smallBlind(sB), startCash(sC), allInCondition(0)
|
LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, PlayerInterface **p, int id, int sP, int aP, 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(aP), startQuantityPlayers(sP), dealerPosition(dP), actualRound(0), smallBlind(sB), startCash(sC), allInCondition(0)
|
||||||
{
|
{
|
||||||
|
|
||||||
int i, j;
|
int i, j, k;
|
||||||
CardsValue myCardsValue;
|
CardsValue myCardsValue;
|
||||||
|
|
||||||
myGui->setHand(this);
|
myGui->setHand(this);
|
||||||
myBoard->setHand(this);
|
myBoard->setHand(this);
|
||||||
|
|
||||||
|
|
||||||
for(i=0; i<startQuantityPlayers; i++) playerArray[i]->setHand(this);
|
for(i=0; i<startQuantityPlayers; i++) {
|
||||||
|
if(playerArray[i]->getMyActiveStatus() != 0) {
|
||||||
|
playerArray[i]->setHand(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// roundStartCashArray fllen
|
// roundStartCashArray fllen
|
||||||
@@ -47,8 +51,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*startQuantityPlayers+5];
|
int *cardsArray = new int[2*actualQuantityPlayers+5];
|
||||||
myTool.getRandNumber(0, 51, 2*startQuantityPlayers+5, cardsArray, 1);
|
myTool.getRandNumber(0, 51, 2*actualQuantityPlayers+5, cardsArray, 1);
|
||||||
int tempBoardArray[5];
|
int tempBoardArray[5];
|
||||||
int tempPlayerArray[2];
|
int tempPlayerArray[2];
|
||||||
int tempPlayerAndBoardArray[7];
|
int tempPlayerAndBoardArray[7];
|
||||||
@@ -56,20 +60,24 @@ LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, Playe
|
|||||||
tempBoardArray[i] = cardsArray[i];
|
tempBoardArray[i] = cardsArray[i];
|
||||||
tempPlayerAndBoardArray[i+2] = cardsArray[i];
|
tempPlayerAndBoardArray[i+2] = cardsArray[i];
|
||||||
}
|
}
|
||||||
|
k = 0;
|
||||||
myBoard->setMyCards(tempBoardArray);
|
myBoard->setMyCards(tempBoardArray);
|
||||||
for(i=0; i<startQuantityPlayers; i++) {
|
for(i=0; i<startQuantityPlayers; i++) {
|
||||||
|
if(playerArray[i]->getMyActiveStatus() != 0) {
|
||||||
for(j=0; j<2; j++) {
|
for(j=0; j<2; j++) {
|
||||||
tempPlayerArray[j] = cardsArray[2*i+j+5];
|
tempPlayerArray[j] = cardsArray[2*k+j+5];
|
||||||
tempPlayerAndBoardArray[j] = cardsArray[2*i+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,playerArray[i]->getMyBestHandPosition()));
|
||||||
// myBestHandPosition auf Fehler ueberpruefen
|
// myBestHandPosition auf Fehler ueberpruefen
|
||||||
for(j=0; j<5; j++) {
|
for(j=0; j<5; j++) {
|
||||||
if((playerArray[i]->getMyBestHandPosition())[i] == -1) {
|
if((playerArray[i]->getMyBestHandPosition())[j] == -1) {
|
||||||
cout << "FEHLER bei myBestHandPosition-Ermittlung!!!" << endl;
|
cout << "FEHLER bei myBestHandPosition-Ermittlung!!!" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
k++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Karten austeilen
|
// Karten austeilen
|
||||||
@@ -81,10 +89,10 @@ LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, Playe
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Preflop, Flop, Turn und River erstellen
|
// Preflop, Flop, Turn und River erstellen
|
||||||
myPreflop = myFactory->createPreflop(this, myID, startQuantityPlayers, dealerPosition, smallBlind);
|
myPreflop = myFactory->createPreflop(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
|
||||||
myFlop = myFactory->createFlop(this, myID, startQuantityPlayers, dealerPosition, smallBlind);
|
myFlop = myFactory->createFlop(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
|
||||||
myTurn = myFactory->createTurn(this, myID, startQuantityPlayers, dealerPosition, smallBlind);
|
myTurn = myFactory->createTurn(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
|
||||||
myRiver = myFactory->createRiver(this, myID, startQuantityPlayers, dealerPosition, smallBlind);
|
myRiver = myFactory->createRiver(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
|
||||||
|
|
||||||
//Rundenwechsel | beim ersten Durchlauf --> Preflop starten
|
//Rundenwechsel | beim ersten Durchlauf --> Preflop starten
|
||||||
myGui->nextPlayerAnimation();
|
myGui->nextPlayerAnimation();
|
||||||
|
|||||||
Reference in New Issue
Block a user