Maximum number of players is now a constant in game_defs.h.
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "localboard.h"
|
||||
|
||||
#include "localhand.h"
|
||||
#include <game_defs.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -40,7 +41,7 @@ void LocalBoard::collectSets() {
|
||||
|
||||
sets = 0;
|
||||
int i;
|
||||
for(i=0; i<actualHand->getGuiInterface()->getMaxQuantityPlayers(); i++) sets += playerArray[i]->getMySet();
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) sets += playerArray[i]->getMySet();
|
||||
|
||||
}
|
||||
|
||||
@@ -48,7 +49,7 @@ void LocalBoard::collectPot() {
|
||||
int i;
|
||||
pot += sets;
|
||||
sets = 0;
|
||||
for(i=0; i<actualHand->getGuiInterface()->getMaxQuantityPlayers(); i++){ playerArray[i]->setMySetNull(); }
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++){ playerArray[i]->setMySetNull(); }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
#include "localflop.h"
|
||||
#include <game_defs.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -27,7 +28,7 @@ LocalFlop::LocalFlop(HandInterface* bR, int id, int qP, int dP, int sB) : FlopIn
|
||||
int i;
|
||||
|
||||
//SmallBlind-Position ermitteln
|
||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if (myHand->getPlayerArray()[i]->getMyButton() == 2) smallBlindPosition = i;
|
||||
}
|
||||
|
||||
@@ -53,7 +54,7 @@ void LocalFlop::flopRun() {
|
||||
bool allHighestSet = 1;
|
||||
|
||||
// prfe, ob alle Sets gleich sind ( falls nicht, dann allHighestSet = 0 )
|
||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(myHand->getPlayerArray()[i]->getMyActiveStatus() && myHand->getPlayerArray()[i]->getMyAction() != 1 && myHand->getPlayerArray()[i]->getMyAction() != 6) {
|
||||
if(highestSet != myHand->getPlayerArray()[i]->getMySet()) { allHighestSet=0; }
|
||||
}
|
||||
@@ -69,7 +70,7 @@ void LocalFlop::flopRun() {
|
||||
myHand->setActualRound(2);
|
||||
|
||||
//Action l�chen und ActionButtons refresh
|
||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(myHand->getPlayerArray()[i]->getMyAction() != 1 && myHand->getPlayerArray()[i]->getMyAction() != 6) myHand->getPlayerArray()[i]->setMyAction(0);
|
||||
}
|
||||
//Sets in den Pot verschieben und Sets = 0 und Pot-refresh
|
||||
@@ -94,12 +95,12 @@ void LocalFlop::flopRun() {
|
||||
|
||||
|
||||
// n�hsten Spieler ermitteln
|
||||
do { playersTurn = (playersTurn+1)%(myHand->getGuiInterface()->getMaxQuantityPlayers());
|
||||
do { playersTurn = (playersTurn+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||
} while(!(myHand->getPlayerArray()[playersTurn]->getMyActiveStatus()) || (myHand->getPlayerArray()[playersTurn]->getMyAction())==1 || (myHand->getPlayerArray()[playersTurn]->getMyAction())==6);
|
||||
|
||||
//Spieler-Position vor SmallBlind-Position ermitteln
|
||||
int activePlayerBeforeSmallBlind = smallBlindPosition;
|
||||
do { activePlayerBeforeSmallBlind = (activePlayerBeforeSmallBlind + myHand->getGuiInterface()->getMaxQuantityPlayers() - 1 ) % (myHand->getGuiInterface()->getMaxQuantityPlayers());
|
||||
do { activePlayerBeforeSmallBlind = (activePlayerBeforeSmallBlind + MAX_NUMBER_OF_PLAYERS - 1 ) % (MAX_NUMBER_OF_PLAYERS);
|
||||
} while(!(myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyActiveStatus()) || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==1 || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==6);
|
||||
|
||||
myHand->getPlayerArray()[playersTurn]->setMyTurn(1);
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
#include "localhand.h"
|
||||
#include <game_defs.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -41,7 +42,7 @@ LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, Playe
|
||||
|
||||
|
||||
// roundStartCashArray fllen
|
||||
for(i=0; i<myGui->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
playerArray[i]->setMyRoundStartCash(playerArray[i]->getMyCash());
|
||||
}
|
||||
|
||||
@@ -135,7 +136,7 @@ void LocalHand::assignButtons() {
|
||||
int i;
|
||||
|
||||
// alle Buttons loeschen
|
||||
for (i=0; i<myGui->getMaxQuantityPlayers(); i++) { playerArray[i]->setMyButton(0); }
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { playerArray[i]->setMyButton(0); }
|
||||
|
||||
// DealerButton zuweisen
|
||||
playerArray[dealerPosition]->setMyButton(1);
|
||||
@@ -143,7 +144,7 @@ void LocalHand::assignButtons() {
|
||||
// Small Blind zuweisen und setzen
|
||||
i = dealerPosition;
|
||||
do {
|
||||
i = (i+1)%(myGui->getMaxQuantityPlayers());
|
||||
i = (i+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||
if(playerArray[i]->getMyActiveStatus()) {
|
||||
playerArray[i]->setMyButton(2);
|
||||
// mit SmallBlind All In ?
|
||||
@@ -163,7 +164,7 @@ void LocalHand::assignButtons() {
|
||||
|
||||
// Big Blind zuweisen
|
||||
do {
|
||||
i = (i+1)%(myGui->getMaxQuantityPlayers());
|
||||
i = (i+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||
if(playerArray[i]->getMyActiveStatus()) {
|
||||
playerArray[i]->setMyButton(3);
|
||||
// mit BigBlind All In ?
|
||||
@@ -191,13 +192,13 @@ void LocalHand::switchRounds() {
|
||||
|
||||
//Aktive Spieler z�len --> wenn nur noch einer nicht-folded dann gleich den Pot verteilen
|
||||
activePlayersCounter = 0;
|
||||
for (i=0; i<myGui->getMaxQuantityPlayers(); i++) {
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if (playerArray[i]->getMyAction() != 1 && playerArray[i]->getMyActiveStatus() == 1) activePlayersCounter++;
|
||||
}
|
||||
|
||||
// Anzahl der Spieler ermitteln, welche All In sind
|
||||
int allInPlayersCounter = 0;
|
||||
for (i=0; i<myGui->getMaxQuantityPlayers(); i++) {
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if (playerArray[i]->getMyAction() == 6) allInPlayersCounter++;
|
||||
}
|
||||
|
||||
@@ -222,7 +223,7 @@ void LocalHand::switchRounds() {
|
||||
int tempHighestSet;
|
||||
if(allInPlayersCounter+1 == activePlayersCounter) {
|
||||
// Spieler ermitteln, der noch nicht All In ist
|
||||
for (i=0; i<myGui->getMaxQuantityPlayers(); i++) {
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(playerArray[i]->getMyAction() != 1 && playerArray[i]->getMyAction() != 6 && playerArray[i]->getMyActiveStatus() == 1) {
|
||||
tempHighestSet = 0;
|
||||
switch (actualRound) {
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "localpreflop.h"
|
||||
|
||||
#include "handinterface.h"
|
||||
#include <game_defs.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -33,7 +34,7 @@ LocalPreflop::LocalPreflop(HandInterface* bR, int id, int qP, int dP, int sB) :
|
||||
// // BigBlind ermitteln
|
||||
bigBlindPosition = dealerPosition;
|
||||
while (myHand->getPlayerArray()[bigBlindPosition]->getMyButton() != 3) {
|
||||
bigBlindPosition = (bigBlindPosition+1)%(myHand->getGuiInterface()->getMaxQuantityPlayers());
|
||||
bigBlindPosition = (bigBlindPosition+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||
}
|
||||
|
||||
// // erste Spielernummer fr preflopRun() setzen
|
||||
@@ -56,7 +57,7 @@ void LocalPreflop::preflopRun() {
|
||||
bool allHighestSet = 1;
|
||||
|
||||
// prfe, ob alle Sets gleich sind ( falls nicht, dann allHighestSet = 0 )
|
||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(myHand->getPlayerArray()[i]->getMyActiveStatus() && myHand->getPlayerArray()[i]->getMyAction() != 1 && myHand->getPlayerArray()[i]->getMyAction() != 6) {
|
||||
if(highestSet != myHand->getPlayerArray()[i]->getMySet()) { allHighestSet=0; }
|
||||
}
|
||||
@@ -65,7 +66,7 @@ void LocalPreflop::preflopRun() {
|
||||
// BigBlind ermitteln
|
||||
bigBlindPosition = dealerPosition;
|
||||
while (myHand->getPlayerArray()[bigBlindPosition]->getMyButton() != 3) {
|
||||
bigBlindPosition = (bigBlindPosition+1)%(myHand->getGuiInterface()->getMaxQuantityPlayers());
|
||||
bigBlindPosition = (bigBlindPosition+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||
}
|
||||
|
||||
// prfen, ob Preflop wirklich dran ist
|
||||
@@ -76,7 +77,7 @@ void LocalPreflop::preflopRun() {
|
||||
myHand->setActualRound(1);
|
||||
|
||||
//Action l�chen und ActionButtons refresh
|
||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(myHand->getPlayerArray()[i]->getMyAction() != 1 && myHand->getPlayerArray()[i]->getMyAction() != 6) myHand->getPlayerArray()[i]->setMyAction(0);
|
||||
}
|
||||
//Sets in den Pot verschieben und Sets = 0 und Pot-refresh
|
||||
@@ -97,7 +98,7 @@ void LocalPreflop::preflopRun() {
|
||||
// n�hsten Spieler ermitteln
|
||||
do {
|
||||
|
||||
playersTurn = (playersTurn+1)%(myHand->getGuiInterface()->getMaxQuantityPlayers());
|
||||
playersTurn = (playersTurn+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||
// falls BigBlind, dann PreflopFirstRound zuende
|
||||
if(myHand->getPlayerArray()[playersTurn]->getMyButton() == 3) preflopFirstRound = 0;
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
#include "localriver.h"
|
||||
#include <game_defs.h>
|
||||
|
||||
|
||||
using namespace std;
|
||||
@@ -27,7 +28,7 @@ LocalRiver::LocalRiver(HandInterface* bR, int id, int qP, int dP, int sB) : Rive
|
||||
{ int i;
|
||||
|
||||
//SmallBlind-Position ermitteln
|
||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if (myHand->getPlayerArray()[i]->getMyButton() == 2) smallBlindPosition = i;
|
||||
}
|
||||
|
||||
@@ -52,7 +53,7 @@ void LocalRiver::riverRun() {
|
||||
bool allHighestSet = 1;
|
||||
|
||||
// prfe, ob alle Sets gleich sind ( falls nicht, dann allHighestSet = 0 )
|
||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(myHand->getPlayerArray()[i]->getMyActiveStatus() && myHand->getPlayerArray()[i]->getMyAction() != 1 && myHand->getPlayerArray()[i]->getMyAction() != 6) {
|
||||
// cout << "Spieler " << i << " Set " << myHand->getPlayerArray()[i]->getMySet() << endl;
|
||||
if(highestSet != myHand->getPlayerArray()[i]->getMySet()) { allHighestSet=0; }
|
||||
@@ -70,7 +71,7 @@ void LocalRiver::riverRun() {
|
||||
myHand->setActualRound(4);
|
||||
|
||||
//Action lᅵchen und ActionButtons refresh
|
||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(myHand->getPlayerArray()[i]->getMyAction() != 1 && myHand->getPlayerArray()[i]->getMyAction() != 6) myHand->getPlayerArray()[i]->setMyAction(0);
|
||||
}
|
||||
//Sets in den Pot verschieben und Sets = 0 und Pot-refresh
|
||||
@@ -94,12 +95,12 @@ void LocalRiver::riverRun() {
|
||||
}
|
||||
|
||||
// nᅵhsten Spieler ermitteln
|
||||
do { playersTurn = (playersTurn+1)%(myHand->getGuiInterface()->getMaxQuantityPlayers());
|
||||
do { playersTurn = (playersTurn+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||
} while(!(myHand->getPlayerArray()[playersTurn]->getMyActiveStatus()) || (myHand->getPlayerArray()[playersTurn]->getMyAction())==1 || (myHand->getPlayerArray()[playersTurn]->getMyAction())==6);
|
||||
|
||||
//Spieler-Position vor SmallBlind-Position ermitteln
|
||||
int activePlayerBeforeSmallBlind = smallBlindPosition;
|
||||
do { activePlayerBeforeSmallBlind = (activePlayerBeforeSmallBlind + myHand->getGuiInterface()->getMaxQuantityPlayers() - 1 ) % (myHand->getGuiInterface()->getMaxQuantityPlayers());
|
||||
do { activePlayerBeforeSmallBlind = (activePlayerBeforeSmallBlind + MAX_NUMBER_OF_PLAYERS - 1 ) % (MAX_NUMBER_OF_PLAYERS);
|
||||
} while(!(myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyActiveStatus()) || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==1 || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==6);
|
||||
|
||||
myHand->getPlayerArray()[playersTurn]->setMyTurn(1);
|
||||
@@ -138,7 +139,7 @@ void LocalRiver::postRiverRun() {
|
||||
// cout << myHand->getPlayerArray()[0]->getMyAverageSets() << endl;
|
||||
|
||||
//berechnen welcher Spieler gewonnen hat
|
||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
|
||||
// cout << "Spieler: " << i << " hat: " << myHand->getPlayerArray()[i]->getMyCardsValueInt() << endl;
|
||||
|
||||
@@ -154,7 +155,7 @@ void LocalRiver::postRiverRun() {
|
||||
// Aggressivität des human player ermitteln
|
||||
// anzahl der player die möglichkeit haben am pot teilzuhaben
|
||||
int potPlayers = 0;
|
||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(myHand->getPlayerArray()[i]->getMyActiveStatus() && myHand->getPlayerArray()[i]->getMyAction() != 1) {
|
||||
potPlayers++;
|
||||
}
|
||||
@@ -202,14 +203,14 @@ void LocalRiver::distributePot() {
|
||||
/////////////////////
|
||||
|
||||
// winnersArray erstellen -> hier werden die winner der jeweiligen Potverteilungsrunden eingetragen
|
||||
int *winnersArray = new int[myHand->getGuiInterface()->getMaxQuantityPlayers()];
|
||||
int *winnersArray = new int[MAX_NUMBER_OF_PLAYERS];
|
||||
|
||||
// Anzahl der winner in einer Potverteilungsrunde
|
||||
int winnersCounter = 0;
|
||||
|
||||
// dieses Array ermittelt wieviel jeder Spieler wᅵrend der gesamten BettingRound gesetzt hat
|
||||
int *roundSetArray = new int[myHand->getGuiInterface()->getMaxQuantityPlayers()];
|
||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||
int *roundSetArray = new int[MAX_NUMBER_OF_PLAYERS];
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
// Standardwert fr nicht mehr aktive
|
||||
roundSetArray[i] = 0;
|
||||
// nur fr die Spieler ermitteln, die noch aktiv sind (inkl. der gefoldeten)
|
||||
@@ -219,10 +220,10 @@ void LocalRiver::distributePot() {
|
||||
}
|
||||
|
||||
// hier steht der CardsValue der Spieler drin die an der Potverteilung teilnehmen (d.h. aktiv und nicht gefoldet), bei allen anderen steht ne 0
|
||||
int *cardsValueArray = new int[myHand->getGuiInterface()->getMaxQuantityPlayers()];
|
||||
int *cardsValueArray = new int[MAX_NUMBER_OF_PLAYERS];
|
||||
int playerWantsPotCounter = 0;
|
||||
|
||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
// Standardwert
|
||||
cardsValueArray[i] = 0;
|
||||
if(myHand->getPlayerArray()[i]->getMyActiveStatus() && myHand->getPlayerArray()[i]->getMyAction() != 1) {
|
||||
@@ -255,7 +256,7 @@ void LocalRiver::distributePot() {
|
||||
highestCardsValueTemp = 0;
|
||||
|
||||
// aktuellen highestCardsValueTemp berechnen, von denen die noch an der Potverteilung teilnehmen
|
||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(cardsValueArray[i] > highestCardsValueTemp ) {
|
||||
highestCardsValueTemp = myHand->getPlayerArray()[i]->getMyCardsValueInt();
|
||||
}
|
||||
@@ -264,7 +265,7 @@ void LocalRiver::distributePot() {
|
||||
// zu Beginn der Potverteilungsrunde die Anzahl der winner auf 0 setzen
|
||||
winnersCounter = 0;
|
||||
// Siegerposition und -anzahl von denen ermitteln, die noch an der Potverteilung teilnehmen
|
||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(cardsValueArray[i] == highestCardsValueTemp ) {
|
||||
winnersArray[winnersCounter] = i;
|
||||
winnersCounter++;
|
||||
@@ -291,7 +292,7 @@ void LocalRiver::distributePot() {
|
||||
// else {
|
||||
|
||||
// alle Spieler nacheinander durchgehen und prfen von wem man wieviel Geld aus dem Pot bekommt
|
||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
|
||||
// zuerst prfen ob ein gefoldeter Spieler was gesetzt hatte
|
||||
if(i != winner && myHand->getPlayerArray()[i]->getMyAction() == 1) {
|
||||
@@ -371,7 +372,7 @@ void LocalRiver::distributePot() {
|
||||
}
|
||||
|
||||
// alle Spieler nacheinander durchgehen und prfen von wem die Winner wieviel Geld aus dem Pot bekommen
|
||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
|
||||
// prfen ob Spieler i zu den Winnern gehᅵt
|
||||
playerIsWinner = 0;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
#include "localturn.h"
|
||||
#include <game_defs.h>
|
||||
|
||||
|
||||
using namespace std;
|
||||
@@ -27,7 +28,7 @@ LocalTurn::LocalTurn(HandInterface* bR, int id, int qP, int dP, int sB) : TurnIn
|
||||
{ int i;
|
||||
|
||||
//SmallBlind-Position ermitteln
|
||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if (myHand->getPlayerArray()[i]->getMyButton() == 2) smallBlindPosition = i;
|
||||
}
|
||||
|
||||
@@ -53,7 +54,7 @@ void LocalTurn::turnRun() {
|
||||
bool allHighestSet = 1;
|
||||
|
||||
// prfe, ob alle Sets gleich sind ( falls nicht, dann allHighestSet = 0 )
|
||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(myHand->getPlayerArray()[i]->getMyActiveStatus() && myHand->getPlayerArray()[i]->getMyAction() != 1 && myHand->getPlayerArray()[i]->getMyAction() != 6) {
|
||||
// cout << "Spieler " << i << " Set " << myHand->getPlayerArray()[i]->getMySet() << endl;
|
||||
if(highestSet != myHand->getPlayerArray()[i]->getMySet()) { allHighestSet=0; }
|
||||
@@ -71,7 +72,7 @@ void LocalTurn::turnRun() {
|
||||
myHand->setActualRound(3);
|
||||
|
||||
//Action l�chen und ActionButtons refresh
|
||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(myHand->getPlayerArray()[i]->getMyAction() != 1 && myHand->getPlayerArray()[i]->getMyAction() != 6) myHand->getPlayerArray()[i]->setMyAction(0);
|
||||
}
|
||||
//Sets in den Pot verschieben und Sets = 0 und Pot-refresh
|
||||
@@ -95,12 +96,12 @@ void LocalTurn::turnRun() {
|
||||
}
|
||||
|
||||
// n�hsten Spieler ermitteln
|
||||
do { playersTurn = (playersTurn+1)%(myHand->getGuiInterface()->getMaxQuantityPlayers());
|
||||
do { playersTurn = (playersTurn+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||
} while(!(myHand->getPlayerArray()[playersTurn]->getMyActiveStatus()) || (myHand->getPlayerArray()[playersTurn]->getMyAction())==1 || (myHand->getPlayerArray()[playersTurn]->getMyAction())==6);
|
||||
|
||||
//Spieler-Position vor SmallBlind-Position ermitteln
|
||||
int activePlayerBeforeSmallBlind = smallBlindPosition;
|
||||
do { activePlayerBeforeSmallBlind = (activePlayerBeforeSmallBlind + myHand->getGuiInterface()->getMaxQuantityPlayers() - 1 ) % (myHand->getGuiInterface()->getMaxQuantityPlayers());
|
||||
do { activePlayerBeforeSmallBlind = (activePlayerBeforeSmallBlind + MAX_NUMBER_OF_PLAYERS - 1 ) % (MAX_NUMBER_OF_PLAYERS);
|
||||
} while(!(myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyActiveStatus()) || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==1 || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==6);
|
||||
|
||||
myHand->getPlayerArray()[playersTurn]->setMyTurn(1);
|
||||
|
||||
+8
-8
@@ -38,7 +38,7 @@ Game::Game(ConfigFile* c, GuiInterface* g, int qP, int sC, int sB, int gId) : my
|
||||
|
||||
actualHandID = 0;
|
||||
|
||||
for(i=0; i<myGui->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
playerArray[i] = 0;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ Game::Game(ConfigFile* c, GuiInterface* g, int qP, int sC, int sB, int gId) : my
|
||||
|
||||
// Player erstellen
|
||||
PlayerInterface *tempPlayer;
|
||||
for(i=0; i<myGui->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
|
||||
//Namen und Avatarpfad abfragen
|
||||
ostringstream myName;
|
||||
@@ -95,7 +95,7 @@ Game::~Game()
|
||||
actualHand = 0;
|
||||
|
||||
PlayerInterface *tempPlayer;
|
||||
for(i=0; i<myGui->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
tempPlayer = playerArray[i];
|
||||
playerArray[i] = 0;
|
||||
delete tempPlayer;
|
||||
@@ -107,7 +107,7 @@ void Game::startHand()
|
||||
{
|
||||
int i;
|
||||
|
||||
//eventuell vorhandene Hand l�chen
|
||||
// eventuell vorhandene Hand löschen
|
||||
if(actualHand) {
|
||||
delete actualHand;
|
||||
actualHand = 0;
|
||||
@@ -120,18 +120,18 @@ void Game::startHand()
|
||||
if(actualHandID%handsBeforeRaiseSmallBLind == 0) actualSmallBlind *= 2;
|
||||
|
||||
//Spieler Action auf 0 setzen
|
||||
for(i=0; i<myGui->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
playerArray[i]->setMyAction(0);
|
||||
}
|
||||
|
||||
// Spieler mit leerem Cash auf inactive setzen
|
||||
for(i=0; i<myGui->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(playerArray[i]->getMyCash() == 0) playerArray[i]->setMyActiveStatus(0);
|
||||
}
|
||||
|
||||
// Anzahl noch aktiver Spieler ermitteln
|
||||
actualQuantityPlayers = 0;
|
||||
for(i=0; i<myGui->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(playerArray[i]->getMyActiveStatus() != 0) actualQuantityPlayers++;
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ void Game::startHand()
|
||||
|
||||
// Dealer-Button weiterschieben --> Achtung inactive
|
||||
do {
|
||||
dealerPosition = (dealerPosition+1)%(myGui->getMaxQuantityPlayers());
|
||||
dealerPosition = (dealerPosition+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||
} while(!(playerArray[dealerPosition]->getMyActiveStatus()));
|
||||
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
#include "game_defs.h"
|
||||
|
||||
class GuiInterface;
|
||||
class HandInterface;
|
||||
class PlayerInterface;
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006 by FThauer FHammer *
|
||||
* f.thauer@web.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
#ifndef GAME_DEFS_H
|
||||
#define GAME_DEFS_H
|
||||
|
||||
#define MAX_NUMBER_OF_PLAYERS 7
|
||||
|
||||
#endif
|
||||
@@ -39,9 +39,6 @@ public:
|
||||
virtual void setHand(HandInterface*) =0;
|
||||
virtual void setSession(Session*) =0;
|
||||
|
||||
//get
|
||||
virtual int getMaxQuantityPlayers() const=0;
|
||||
|
||||
//refresh-Funktionen
|
||||
virtual void refreshSet() const=0;
|
||||
virtual void refreshCash() const=0;
|
||||
|
||||
@@ -45,8 +45,6 @@ void GuiWrapper::setGame(Game *g) { myW->setGame(g); }
|
||||
void GuiWrapper::setHand(HandInterface *lh) { myW->setHand(lh); }
|
||||
void GuiWrapper::setSession(Session *s) { myW->setSession(s); }
|
||||
|
||||
int GuiWrapper::getMaxQuantityPlayers() const { return myW->getMaxQuantityPlayers(); }
|
||||
|
||||
void GuiWrapper::refreshSet() const { myW->refreshSet(); }
|
||||
void GuiWrapper::refreshCash() const { myW->refreshCash(); }
|
||||
void GuiWrapper::refreshAction(int playerID, int playerAction) const { myW->refreshAction(playerID, playerAction); }
|
||||
|
||||
@@ -47,8 +47,6 @@ public:
|
||||
void setHand(HandInterface*);
|
||||
void setSession(Session*);
|
||||
|
||||
int getMaxQuantityPlayers() const;
|
||||
|
||||
void refreshSet() const;
|
||||
void refreshCash() const;
|
||||
void refreshAction(int =-1, int =-1) const;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "log.h"
|
||||
|
||||
#include "mainwindowimpl.h"
|
||||
#include <game_defs.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -150,7 +151,7 @@ void Log::logNewGameHandMsg(int gameID, int handID) {
|
||||
|
||||
//Aktive Spieler zählen
|
||||
int activePlayersCounter = 0;
|
||||
for (k=0; k<myW->getMaxQuantityPlayers(); k++) {
|
||||
for (k=0; k<MAX_NUMBER_OF_PLAYERS; k++) {
|
||||
if (myW->getActualHand()->getPlayerArray()[k]->getMyActiveStatus() == 1) activePlayersCounter++;
|
||||
}
|
||||
k = 0;
|
||||
@@ -193,12 +194,12 @@ void Log::logNewGameHandMsg(int gameID, int handID) {
|
||||
}
|
||||
}
|
||||
stream << "</br>BLINDS: ";
|
||||
for(i=0; i<myW->getMaxQuantityPlayers(); i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
|
||||
j = 0;
|
||||
//Aktive Spieler zählen
|
||||
int activePlayersCounter = 0;
|
||||
for (k=0; k<myW->getMaxQuantityPlayers(); k++) {
|
||||
for (k=0; k<MAX_NUMBER_OF_PLAYERS; k++) {
|
||||
if (myW->getActualHand()->getPlayerArray()[k]->getMyAction() != 1 && myW->getActualHand()->getPlayerArray()[k]->getMyActiveStatus() == 1) activePlayersCounter++;
|
||||
}
|
||||
if(activePlayersCounter < 3) { j=1; }
|
||||
@@ -206,10 +207,10 @@ void Log::logNewGameHandMsg(int gameID, int handID) {
|
||||
// cout << activePlayersCounter << endl;
|
||||
// cout << (i+myW->getActualHand()->getDealerPosition()+j)%5 << endl;
|
||||
|
||||
switch (myW->getActualHand()->getPlayerArray()[(i+myW->getActualHand()->getDealerPosition()+j)%myW->getMaxQuantityPlayers()]->getMyButton()) {
|
||||
case 2 : stream << QString::fromUtf8(myW->getActualHand()->getPlayerArray()[(i+myW->getActualHand()->getDealerPosition()+j)%myW->getMaxQuantityPlayers()]->getMyName().c_str())+" ("+QString::number(myW->getActualHand()->getPlayerArray()[(i+myW->getActualHand()->getDealerPosition()+j)%myW->getMaxQuantityPlayers()]->getMySet(),10)+"$), ";
|
||||
switch (myW->getActualHand()->getPlayerArray()[(i+myW->getActualHand()->getDealerPosition()+j)%MAX_NUMBER_OF_PLAYERS]->getMyButton()) {
|
||||
case 2 : stream << QString::fromUtf8(myW->getActualHand()->getPlayerArray()[(i+myW->getActualHand()->getDealerPosition()+j)%MAX_NUMBER_OF_PLAYERS]->getMyName().c_str())+" ("+QString::number(myW->getActualHand()->getPlayerArray()[(i+myW->getActualHand()->getDealerPosition()+j)%MAX_NUMBER_OF_PLAYERS]->getMySet(),10)+"$), ";
|
||||
break;
|
||||
case 3 : stream << QString::fromUtf8(myW->getActualHand()->getPlayerArray()[(i+myW->getActualHand()->getDealerPosition()+j)%myW->getMaxQuantityPlayers()]->getMyName().c_str())+" ("+QString::number(myW->getActualHand()->getPlayerArray()[(i+myW->getActualHand()->getDealerPosition()+j)%myW->getMaxQuantityPlayers()]->getMySet(),10)+"$)";
|
||||
case 3 : stream << QString::fromUtf8(myW->getActualHand()->getPlayerArray()[(i+myW->getActualHand()->getDealerPosition()+j)%MAX_NUMBER_OF_PLAYERS]->getMyName().c_str())+" ("+QString::number(myW->getActualHand()->getPlayerArray()[(i+myW->getActualHand()->getDealerPosition()+j)%MAX_NUMBER_OF_PLAYERS]->getMySet(),10)+"$)";
|
||||
break;
|
||||
default :;
|
||||
}
|
||||
|
||||
@@ -45,16 +45,11 @@
|
||||
#define FORMATLEFT(X) "<p align='center'>(X)"
|
||||
#define FORMATRIGHT(X) "(X)</p>"
|
||||
|
||||
// muss mit GUI übereinstimmen
|
||||
const int maxQuantityPlayersConst = 7;
|
||||
// !!! in game.h ebenfalls bei playerArray[?] setzen !!!
|
||||
// !!! in hand.h ebenfalls bei roundStartCashArray[?] setzen !!!
|
||||
// !!! in mainwindowimpl.h ebenfalls bei *LabelArray[?] setzen !!!
|
||||
|
||||
using namespace std;
|
||||
|
||||
mainWindowImpl::mainWindowImpl(QMainWindow *parent)
|
||||
: QMainWindow(parent), actualGame(0), actualHand(0), mySession(0), maxQuantityPlayers(maxQuantityPlayersConst), gameSpeed(0), debugMode(0), breakAfterActualHand(FALSE)
|
||||
: QMainWindow(parent), actualGame(0), actualHand(0), mySession(0), gameSpeed(0), debugMode(0), breakAfterActualHand(FALSE)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -412,7 +407,7 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent)
|
||||
label_Pot->setFont(tmpFont2);
|
||||
|
||||
tmpFont2.setPixelSize(10);
|
||||
for (i=0; i<maxQuantityPlayers; i++) {
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
|
||||
cashTopLabelArray[i]->setFont(tmpFont2);
|
||||
cashLabelArray[i]->setFont(tmpFont2);
|
||||
@@ -421,13 +416,13 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent)
|
||||
spinBox_set->setFont(tmpFont2);
|
||||
|
||||
tmpFont2.setPixelSize(12);
|
||||
for (i=0; i<maxQuantityPlayers; i++) {
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
|
||||
setLabelArray[i]->setFont(tmpFont2);
|
||||
}
|
||||
|
||||
tmpFont2.setPixelSize(13);
|
||||
for (i=0; i<maxQuantityPlayers; i++) {
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
|
||||
playerNameLabelArray[i]->setFont(tmpFont2);
|
||||
}
|
||||
@@ -448,7 +443,7 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent)
|
||||
|
||||
//Widgets Grafiken per Stylesheets setzen
|
||||
//Groupbox Background
|
||||
for (i=1; i<maxQuantityPlayers; i++) {
|
||||
for (i=1; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
|
||||
groupBoxArray[i]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/opponentBoxInactiveGlow.png) }");
|
||||
}
|
||||
@@ -462,7 +457,7 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent)
|
||||
|
||||
|
||||
//raise actionLable above just inserted mypixmaplabel
|
||||
for (i=0; i<maxQuantityPlayers; i++) { actionLabelArray[i]->raise(); }
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { actionLabelArray[i]->raise(); }
|
||||
|
||||
|
||||
//ShortCuts
|
||||
@@ -741,7 +736,7 @@ void mainWindowImpl::callSettingsDialog() {
|
||||
|
||||
int i,j;
|
||||
|
||||
for (i=1; i<maxQuantityPlayers; i++ ) {
|
||||
for (i=1; i<MAX_NUMBER_OF_PLAYERS; i++ ) {
|
||||
for ( j=0; j<=1; j++ ) {
|
||||
if (holeCardsArray[i][j]->getIsFlipside()) {
|
||||
holeCardsArray[i][j]->setPixmap(*flipside, TRUE);
|
||||
@@ -765,7 +760,7 @@ void mainWindowImpl::setLog(Log* l) { myLog = l; }
|
||||
void mainWindowImpl::refreshSet() {
|
||||
|
||||
int i;
|
||||
for (i=0; i<maxQuantityPlayers; i++) {
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(actualHand->getPlayerArray()[i]->getMySet() == 0) setLabelArray[i]->setText("");
|
||||
else setLabelArray[i]->setText("<p align='center'><b>Set:</b> "+QString::number(actualHand->getPlayerArray()[i]->getMySet(),10)+" $</p>");
|
||||
}
|
||||
@@ -780,11 +775,11 @@ void mainWindowImpl::refreshButton() {
|
||||
int k;
|
||||
//Aktive Spieler zählen
|
||||
int activePlayersCounter = 0;
|
||||
for (k=0; k<maxQuantityPlayers; k++) {
|
||||
for (k=0; k<MAX_NUMBER_OF_PLAYERS; k++) {
|
||||
if (actualHand->getPlayerArray()[k]->getMyActiveStatus() == 1) activePlayersCounter++;
|
||||
}
|
||||
|
||||
for (i=0; i<maxQuantityPlayers; i++) {
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus()) {
|
||||
if(activePlayersCounter > 2) {
|
||||
if (actualHand->getPlayerArray()[i]->getMyButton()==1) {
|
||||
@@ -810,7 +805,7 @@ void mainWindowImpl::refreshButton() {
|
||||
void mainWindowImpl::refreshPlayerName() {
|
||||
|
||||
int i;
|
||||
for (i=0; i<maxQuantityPlayers; i++) {
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus()) {
|
||||
playerNameLabelArray[i]->setText(QString::fromUtf8(actualHand->getPlayerArray()[i]->getMyName().c_str()));
|
||||
|
||||
@@ -827,7 +822,7 @@ void mainWindowImpl::refreshPlayerAvatar() {
|
||||
QPixmap onePix(":/graphics/resources/graphics/1px.png");
|
||||
int i;
|
||||
|
||||
for (i=0; i<maxQuantityPlayers; i++) {
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus()) {
|
||||
|
||||
if(!i) {
|
||||
@@ -864,7 +859,7 @@ void mainWindowImpl::refreshAction(int playerID, int playerAction) {
|
||||
if(playerID == -1 || playerAction == -1) {
|
||||
|
||||
int i;
|
||||
for (i=0; i<maxQuantityPlayers; i++) {
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
|
||||
//if no action --> clear Pixmap
|
||||
if(actualHand->getPlayerArray()[i]->getMyAction() == 0) {
|
||||
@@ -913,7 +908,7 @@ void mainWindowImpl::refreshAction(int playerID, int playerAction) {
|
||||
void mainWindowImpl::refreshCash() {
|
||||
|
||||
int i;
|
||||
for (i=0; i<maxQuantityPlayers; i++) {
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus()) {
|
||||
|
||||
cashLabelArray[i]->setText(QString::number(actualHand->getPlayerArray()[i]->getMyCash(),10)+" $");
|
||||
@@ -931,7 +926,7 @@ void mainWindowImpl::refreshGroupbox(int playerID, int status) {
|
||||
if(playerID == -1 || status == -1) {
|
||||
|
||||
int i,j;
|
||||
for (i=0; i<maxQuantityPlayers; i++) {
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
|
||||
if(actualHand->getPlayerArray()[i]->getMyTurn()) {
|
||||
//Groupbox glow wenn der Spiele dran ist.
|
||||
@@ -1061,7 +1056,7 @@ void mainWindowImpl::dealHoleCards() {
|
||||
|
||||
// Karten der Gegner austeilen
|
||||
int i, j;
|
||||
for(i=1; i<maxQuantityPlayers; i++) {
|
||||
for(i=1; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
actualHand->getPlayerArray()[i]->getMyCards(tempCardsIntArray);
|
||||
for(j=0; j<2; j++) {
|
||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus()) {
|
||||
@@ -1631,7 +1626,7 @@ void mainWindowImpl::postRiverRunAnimation2() {
|
||||
|
||||
//Aktive Spieler zählen --> wenn nur noch einer nicht-folded dann keine Karten umdrehen
|
||||
int activePlayersCounter = 0;
|
||||
for (i=0; i<maxQuantityPlayers; i++) {
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if (actualHand->getPlayerArray()[i]->getMyAction() != 1 && actualHand->getPlayerArray()[i]->getMyActiveStatus() == 1) activePlayersCounter++;
|
||||
}
|
||||
|
||||
@@ -1648,7 +1643,7 @@ void mainWindowImpl::postRiverRunAnimation2() {
|
||||
|
||||
int i, j;
|
||||
|
||||
for(i=0; i<maxQuantityPlayers; i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
actualHand->getPlayerArray()[i]->getMyCards(tempCardsIntArray);
|
||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus() && actualHand->getPlayerArray()[i]->getMyAction() != 1) {
|
||||
if(i) {
|
||||
@@ -1675,7 +1670,7 @@ void mainWindowImpl::postRiverRunAnimation2() {
|
||||
int tempCardsIntArray[2];
|
||||
|
||||
int i, j;
|
||||
for(i=0; i<maxQuantityPlayers; i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
actualHand->getPlayerArray()[i]->getMyCards(tempCardsIntArray);
|
||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus() && actualHand->getPlayerArray()[i]->getMyAction() != 1) {
|
||||
if(i) {
|
||||
@@ -1698,7 +1693,7 @@ void mainWindowImpl::postRiverRunAnimation2() {
|
||||
else {
|
||||
int tempCardsIntArray[2];
|
||||
int i;
|
||||
for(i=0; i<maxQuantityPlayers; i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
actualHand->getPlayerArray()[i]->getMyCards(tempCardsIntArray);
|
||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus() && actualHand->getPlayerArray()[i]->getMyAction() != 1) {
|
||||
|
||||
@@ -1718,7 +1713,7 @@ void mainWindowImpl::postRiverRunAnimation3() {
|
||||
// cout << "Neue Runde" << endl;
|
||||
|
||||
//Alle Winner erhellen und "Winner" schreiben
|
||||
for(i=0; i<maxQuantityPlayers; i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus() && actualHand->getPlayerArray()[i]->getMyAction() != 1 && actualHand->getPlayerArray()[i]->getMyCardsValueInt() == actualHand->getRiver()->getHighestCardsValue() ) {
|
||||
|
||||
// QPalette tempPalette = groupBoxArray[i]->palette();
|
||||
@@ -1733,44 +1728,44 @@ void mainWindowImpl::postRiverRunAnimation3() {
|
||||
|
||||
//index 0 testen --> Karte darf nicht im MyBestHand Position Array drin sein, es darf nicht nur ein Spieler Aktiv sein, die Config fordert die Animation
|
||||
bool index0 = TRUE;
|
||||
for(j=0; j<maxQuantityPlayers; j++) {
|
||||
for(j=0; j<MAX_NUMBER_OF_PLAYERS; j++) {
|
||||
// cout << (actualHand->getPlayerArray()[i]->getMyBestHandPosition())[j] << endl;
|
||||
if ((actualHand->getPlayerArray()[i]->getMyBestHandPosition())[j] == 0 ) { index0 = FALSE; }
|
||||
}
|
||||
if (index0) { holeCardsArray[i][0]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index0" << endl;*/}
|
||||
//index 1 testen
|
||||
bool index1 = TRUE;
|
||||
for(j=0; j<maxQuantityPlayers; j++) {
|
||||
for(j=0; j<MAX_NUMBER_OF_PLAYERS; j++) {
|
||||
if ((actualHand->getPlayerArray()[i]->getMyBestHandPosition())[j] == 1 ) { index1 = FALSE; }
|
||||
}
|
||||
if (index1) { holeCardsArray[i][1]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index1" << endl;*/}
|
||||
//index 2 testen
|
||||
bool index2 = TRUE;
|
||||
for(j=0; j<maxQuantityPlayers; j++) {
|
||||
for(j=0; j<MAX_NUMBER_OF_PLAYERS; j++) {
|
||||
if ((actualHand->getPlayerArray()[i]->getMyBestHandPosition())[j] == 2 ) { index2 = FALSE; }
|
||||
}
|
||||
if (index2) { boardCardsArray[0]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index2" << endl;*/}
|
||||
//index 3 testen
|
||||
bool index3 = TRUE;
|
||||
for(j=0; j<maxQuantityPlayers; j++) {
|
||||
for(j=0; j<MAX_NUMBER_OF_PLAYERS; j++) {
|
||||
if ((actualHand->getPlayerArray()[i]->getMyBestHandPosition())[j] == 3 ) { index3 = FALSE; }
|
||||
}
|
||||
if (index3) { boardCardsArray[1]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index3" << endl;*/}
|
||||
//index 4 testen
|
||||
bool index4 = TRUE;
|
||||
for(j=0; j<maxQuantityPlayers; j++) {
|
||||
for(j=0; j<MAX_NUMBER_OF_PLAYERS; j++) {
|
||||
if ((actualHand->getPlayerArray()[i]->getMyBestHandPosition())[j] == 4 ) { index4 = FALSE; }
|
||||
}
|
||||
if (index4) { boardCardsArray[2]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index4" << endl;*/}
|
||||
//index 5 testen
|
||||
bool index5 = TRUE;
|
||||
for(j=0; j<maxQuantityPlayers; j++) {
|
||||
for(j=0; j<MAX_NUMBER_OF_PLAYERS; j++) {
|
||||
if ((actualHand->getPlayerArray()[i]->getMyBestHandPosition())[j] == 5 ) { index5 = FALSE; }
|
||||
}
|
||||
if (index5) { boardCardsArray[3]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index5" << endl;*/}
|
||||
//index 6 testen
|
||||
bool index6 = TRUE;
|
||||
for(j=0; j<maxQuantityPlayers; j++) {
|
||||
for(j=0; j<MAX_NUMBER_OF_PLAYERS; j++) {
|
||||
if ((actualHand->getPlayerArray()[i]->getMyBestHandPosition())[j] == 6 ) { index6 = FALSE; }
|
||||
}
|
||||
if (index6) { boardCardsArray[4]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index6" << endl;*/}
|
||||
@@ -1818,7 +1813,7 @@ void mainWindowImpl::postRiverRunAnimation5() {
|
||||
|
||||
label_Pot->setText("");
|
||||
|
||||
for(i=0; i<maxQuantityPlayers; i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus() && actualHand->getPlayerArray()[i]->getMyAction() != 1 && actualHand->getPlayerArray()[i]->getMyCardsValueInt() == actualHand->getRiver()->getHighestCardsValue() ) {
|
||||
|
||||
cashTopLabelArray[i]->setText("");
|
||||
@@ -1828,7 +1823,7 @@ void mainWindowImpl::postRiverRunAnimation5() {
|
||||
else {
|
||||
label_Pot->setText("<span style='font-weight:bold'>Pot</span>");
|
||||
|
||||
for(i=0; i<maxQuantityPlayers; i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus() && actualHand->getPlayerArray()[i]->getMyAction() != 1 && actualHand->getPlayerArray()[i]->getMyCardsValueInt() == actualHand->getRiver()->getHighestCardsValue() ) {
|
||||
|
||||
cashTopLabelArray[i]->setText("<b>Cash:</b>");
|
||||
@@ -1888,7 +1883,7 @@ void mainWindowImpl::flipHolecardsAllIn() {
|
||||
if(!flipHolecardsAllInAlreadyDone) {
|
||||
//Aktive Spieler zählen --> wenn nur noch einer nicht-folded dann keine Karten umdrehen
|
||||
int activePlayersCounter = 0;
|
||||
for (i=0; i<maxQuantityPlayers; i++) {
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if (actualHand->getPlayerArray()[i]->getMyAction() != 1 && actualHand->getPlayerArray()[i]->getMyActiveStatus() == 1) activePlayersCounter++;
|
||||
}
|
||||
|
||||
@@ -1903,7 +1898,7 @@ void mainWindowImpl::flipHolecardsAllIn() {
|
||||
|
||||
int i, j;
|
||||
|
||||
for(i=0; i<maxQuantityPlayers; i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
actualHand->getPlayerArray()[i]->getMyCards(tempCardsIntArray);
|
||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus() && actualHand->getPlayerArray()[i]->getMyAction() != 1) {
|
||||
if(i) {
|
||||
@@ -1930,7 +1925,7 @@ void mainWindowImpl::flipHolecardsAllIn() {
|
||||
int temp2CardsIntArray[2];
|
||||
|
||||
int i, j;
|
||||
for(i=0; i<maxQuantityPlayers; i++) {
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
actualHand->getPlayerArray()[i]->getMyCards(temp2CardsIntArray);
|
||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus() && actualHand->getPlayerArray()[i]->getMyAction() != 1) {
|
||||
if(i) {
|
||||
@@ -1993,7 +1988,7 @@ void mainWindowImpl::nextRoundCleanGui() {
|
||||
boardCardsArray[i]->setFadeOutAction(FALSE);
|
||||
|
||||
}
|
||||
for (i=0; i<maxQuantityPlayers; i++ ) {
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++ ) {
|
||||
for ( j=0; j<=1; j++ ) { holeCardsArray[i][j]->setFadeOutAction(FALSE);}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,9 +28,10 @@
|
||||
#include <QtCore>
|
||||
|
||||
#include "handinterface.h"
|
||||
#include "game_defs.h"
|
||||
|
||||
class Game;
|
||||
class Session;
|
||||
class Game;
|
||||
class Log;
|
||||
class ConfigFile;
|
||||
|
||||
@@ -61,8 +62,6 @@ public:
|
||||
void setSession(Session*);
|
||||
void setLog(Log*);
|
||||
|
||||
int getMaxQuantityPlayers() const { return maxQuantityPlayers; }
|
||||
|
||||
void setActualHand(HandInterface* theValue) { actualHand = theValue;}
|
||||
HandInterface* getActualHand() const { return actualHand;}
|
||||
|
||||
@@ -225,7 +224,7 @@ private:
|
||||
MyCardsPixmapLabel *pixmapLabel_card6b;
|
||||
//Timer
|
||||
QTimer *potDistributeTimer;
|
||||
QTimer *timer;
|
||||
QTimer *timer;
|
||||
QTimer *dealFlopCards0Timer;
|
||||
QTimer *dealFlopCards1Timer;
|
||||
QTimer *dealFlopCards2Timer;
|
||||
@@ -258,17 +257,17 @@ private:
|
||||
QTimer *postRiverRunAnimation6Timer;
|
||||
|
||||
QWidget *userWidgetsArray[4];
|
||||
QLabel *buttonLabelArray[7];
|
||||
QLabel *cashLabelArray[7];
|
||||
QLabel *cashTopLabelArray[7];
|
||||
QLabel *setLabelArray[7];
|
||||
QLabel *actionLabelArray[7];
|
||||
QLabel *playerNameLabelArray[7];
|
||||
QLabel *playerAvatarLabelArray[7];
|
||||
QLabel *buttonLabelArray[MAX_NUMBER_OF_PLAYERS];
|
||||
QLabel *cashLabelArray[MAX_NUMBER_OF_PLAYERS];
|
||||
QLabel *cashTopLabelArray[MAX_NUMBER_OF_PLAYERS];
|
||||
QLabel *setLabelArray[MAX_NUMBER_OF_PLAYERS];
|
||||
QLabel *actionLabelArray[MAX_NUMBER_OF_PLAYERS];
|
||||
QLabel *playerNameLabelArray[MAX_NUMBER_OF_PLAYERS];
|
||||
QLabel *playerAvatarLabelArray[MAX_NUMBER_OF_PLAYERS];
|
||||
|
||||
QGroupBox *groupBoxArray[7];
|
||||
QGroupBox *groupBoxArray[MAX_NUMBER_OF_PLAYERS];
|
||||
MyCardsPixmapLabel *boardCardsArray[5];
|
||||
MyCardsPixmapLabel *holeCardsArray[7][2];
|
||||
MyCardsPixmapLabel *holeCardsArray[MAX_NUMBER_OF_PLAYERS][2];
|
||||
|
||||
QPixmap *flipside;
|
||||
|
||||
@@ -279,8 +278,6 @@ private:
|
||||
createNetworkGameDialogImpl *myCreateNetworkGameDialog;
|
||||
waitForServerToStartGameDialogImpl *myWaitingForServerGameDialog;
|
||||
|
||||
int maxQuantityPlayers;
|
||||
|
||||
int distributePotAnimCounter;
|
||||
|
||||
//Speed
|
||||
|
||||
Reference in New Issue
Block a user