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 "localboard.h"
|
||||||
|
|
||||||
#include "localhand.h"
|
#include "localhand.h"
|
||||||
|
#include <game_defs.h>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@@ -40,7 +41,7 @@ void LocalBoard::collectSets() {
|
|||||||
|
|
||||||
sets = 0;
|
sets = 0;
|
||||||
int i;
|
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;
|
int i;
|
||||||
pot += sets;
|
pot += sets;
|
||||||
sets = 0;
|
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. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#include "localflop.h"
|
#include "localflop.h"
|
||||||
|
#include <game_defs.h>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@@ -27,7 +28,7 @@ LocalFlop::LocalFlop(HandInterface* bR, int id, int qP, int dP, int sB) : FlopIn
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
//SmallBlind-Position ermitteln
|
//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;
|
if (myHand->getPlayerArray()[i]->getMyButton() == 2) smallBlindPosition = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,7 +54,7 @@ void LocalFlop::flopRun() {
|
|||||||
bool allHighestSet = 1;
|
bool allHighestSet = 1;
|
||||||
|
|
||||||
// prfe, ob alle Sets gleich sind ( falls nicht, dann allHighestSet = 0 )
|
// 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(myHand->getPlayerArray()[i]->getMyActiveStatus() && myHand->getPlayerArray()[i]->getMyAction() != 1 && myHand->getPlayerArray()[i]->getMyAction() != 6) {
|
||||||
if(highestSet != myHand->getPlayerArray()[i]->getMySet()) { allHighestSet=0; }
|
if(highestSet != myHand->getPlayerArray()[i]->getMySet()) { allHighestSet=0; }
|
||||||
}
|
}
|
||||||
@@ -69,7 +70,7 @@ void LocalFlop::flopRun() {
|
|||||||
myHand->setActualRound(2);
|
myHand->setActualRound(2);
|
||||||
|
|
||||||
//Action l�chen und ActionButtons refresh
|
//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);
|
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
|
//Sets in den Pot verschieben und Sets = 0 und Pot-refresh
|
||||||
@@ -94,12 +95,12 @@ void LocalFlop::flopRun() {
|
|||||||
|
|
||||||
|
|
||||||
// n�hsten Spieler ermitteln
|
// 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);
|
} while(!(myHand->getPlayerArray()[playersTurn]->getMyActiveStatus()) || (myHand->getPlayerArray()[playersTurn]->getMyAction())==1 || (myHand->getPlayerArray()[playersTurn]->getMyAction())==6);
|
||||||
|
|
||||||
//Spieler-Position vor SmallBlind-Position ermitteln
|
//Spieler-Position vor SmallBlind-Position ermitteln
|
||||||
int activePlayerBeforeSmallBlind = smallBlindPosition;
|
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);
|
} while(!(myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyActiveStatus()) || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==1 || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==6);
|
||||||
|
|
||||||
myHand->getPlayerArray()[playersTurn]->setMyTurn(1);
|
myHand->getPlayerArray()[playersTurn]->setMyTurn(1);
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#include "localhand.h"
|
#include "localhand.h"
|
||||||
|
#include <game_defs.h>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@@ -41,7 +42,7 @@ LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, Playe
|
|||||||
|
|
||||||
|
|
||||||
// roundStartCashArray fllen
|
// roundStartCashArray fllen
|
||||||
for(i=0; i<myGui->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
playerArray[i]->setMyRoundStartCash(playerArray[i]->getMyCash());
|
playerArray[i]->setMyRoundStartCash(playerArray[i]->getMyCash());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,7 +136,7 @@ void LocalHand::assignButtons() {
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
// alle Buttons loeschen
|
// 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
|
// DealerButton zuweisen
|
||||||
playerArray[dealerPosition]->setMyButton(1);
|
playerArray[dealerPosition]->setMyButton(1);
|
||||||
@@ -143,7 +144,7 @@ void LocalHand::assignButtons() {
|
|||||||
// Small Blind zuweisen und setzen
|
// Small Blind zuweisen und setzen
|
||||||
i = dealerPosition;
|
i = dealerPosition;
|
||||||
do {
|
do {
|
||||||
i = (i+1)%(myGui->getMaxQuantityPlayers());
|
i = (i+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||||
if(playerArray[i]->getMyActiveStatus()) {
|
if(playerArray[i]->getMyActiveStatus()) {
|
||||||
playerArray[i]->setMyButton(2);
|
playerArray[i]->setMyButton(2);
|
||||||
// mit SmallBlind All In ?
|
// mit SmallBlind All In ?
|
||||||
@@ -163,7 +164,7 @@ void LocalHand::assignButtons() {
|
|||||||
|
|
||||||
// Big Blind zuweisen
|
// Big Blind zuweisen
|
||||||
do {
|
do {
|
||||||
i = (i+1)%(myGui->getMaxQuantityPlayers());
|
i = (i+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||||
if(playerArray[i]->getMyActiveStatus()) {
|
if(playerArray[i]->getMyActiveStatus()) {
|
||||||
playerArray[i]->setMyButton(3);
|
playerArray[i]->setMyButton(3);
|
||||||
// mit BigBlind All In ?
|
// 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
|
//Aktive Spieler z�len --> wenn nur noch einer nicht-folded dann gleich den Pot verteilen
|
||||||
activePlayersCounter = 0;
|
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++;
|
if (playerArray[i]->getMyAction() != 1 && playerArray[i]->getMyActiveStatus() == 1) activePlayersCounter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Anzahl der Spieler ermitteln, welche All In sind
|
// Anzahl der Spieler ermitteln, welche All In sind
|
||||||
int allInPlayersCounter = 0;
|
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++;
|
if (playerArray[i]->getMyAction() == 6) allInPlayersCounter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,7 +223,7 @@ void LocalHand::switchRounds() {
|
|||||||
int tempHighestSet;
|
int tempHighestSet;
|
||||||
if(allInPlayersCounter+1 == activePlayersCounter) {
|
if(allInPlayersCounter+1 == activePlayersCounter) {
|
||||||
// Spieler ermitteln, der noch nicht All In ist
|
// 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) {
|
if(playerArray[i]->getMyAction() != 1 && playerArray[i]->getMyAction() != 6 && playerArray[i]->getMyActiveStatus() == 1) {
|
||||||
tempHighestSet = 0;
|
tempHighestSet = 0;
|
||||||
switch (actualRound) {
|
switch (actualRound) {
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include "localpreflop.h"
|
#include "localpreflop.h"
|
||||||
|
|
||||||
#include "handinterface.h"
|
#include "handinterface.h"
|
||||||
|
#include <game_defs.h>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@@ -33,7 +34,7 @@ LocalPreflop::LocalPreflop(HandInterface* bR, int id, int qP, int dP, int sB) :
|
|||||||
// // BigBlind ermitteln
|
// // BigBlind ermitteln
|
||||||
bigBlindPosition = dealerPosition;
|
bigBlindPosition = dealerPosition;
|
||||||
while (myHand->getPlayerArray()[bigBlindPosition]->getMyButton() != 3) {
|
while (myHand->getPlayerArray()[bigBlindPosition]->getMyButton() != 3) {
|
||||||
bigBlindPosition = (bigBlindPosition+1)%(myHand->getGuiInterface()->getMaxQuantityPlayers());
|
bigBlindPosition = (bigBlindPosition+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// // erste Spielernummer fr preflopRun() setzen
|
// // erste Spielernummer fr preflopRun() setzen
|
||||||
@@ -56,7 +57,7 @@ void LocalPreflop::preflopRun() {
|
|||||||
bool allHighestSet = 1;
|
bool allHighestSet = 1;
|
||||||
|
|
||||||
// prfe, ob alle Sets gleich sind ( falls nicht, dann allHighestSet = 0 )
|
// 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(myHand->getPlayerArray()[i]->getMyActiveStatus() && myHand->getPlayerArray()[i]->getMyAction() != 1 && myHand->getPlayerArray()[i]->getMyAction() != 6) {
|
||||||
if(highestSet != myHand->getPlayerArray()[i]->getMySet()) { allHighestSet=0; }
|
if(highestSet != myHand->getPlayerArray()[i]->getMySet()) { allHighestSet=0; }
|
||||||
}
|
}
|
||||||
@@ -65,7 +66,7 @@ void LocalPreflop::preflopRun() {
|
|||||||
// BigBlind ermitteln
|
// BigBlind ermitteln
|
||||||
bigBlindPosition = dealerPosition;
|
bigBlindPosition = dealerPosition;
|
||||||
while (myHand->getPlayerArray()[bigBlindPosition]->getMyButton() != 3) {
|
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
|
// prfen, ob Preflop wirklich dran ist
|
||||||
@@ -76,7 +77,7 @@ void LocalPreflop::preflopRun() {
|
|||||||
myHand->setActualRound(1);
|
myHand->setActualRound(1);
|
||||||
|
|
||||||
//Action l�chen und ActionButtons refresh
|
//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);
|
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
|
//Sets in den Pot verschieben und Sets = 0 und Pot-refresh
|
||||||
@@ -97,7 +98,7 @@ void LocalPreflop::preflopRun() {
|
|||||||
// n�hsten Spieler ermitteln
|
// n�hsten Spieler ermitteln
|
||||||
do {
|
do {
|
||||||
|
|
||||||
playersTurn = (playersTurn+1)%(myHand->getGuiInterface()->getMaxQuantityPlayers());
|
playersTurn = (playersTurn+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||||
// falls BigBlind, dann PreflopFirstRound zuende
|
// falls BigBlind, dann PreflopFirstRound zuende
|
||||||
if(myHand->getPlayerArray()[playersTurn]->getMyButton() == 3) preflopFirstRound = 0;
|
if(myHand->getPlayerArray()[playersTurn]->getMyButton() == 3) preflopFirstRound = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#include "localriver.h"
|
#include "localriver.h"
|
||||||
|
#include <game_defs.h>
|
||||||
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@@ -27,7 +28,7 @@ LocalRiver::LocalRiver(HandInterface* bR, int id, int qP, int dP, int sB) : Rive
|
|||||||
{ int i;
|
{ int i;
|
||||||
|
|
||||||
//SmallBlind-Position ermitteln
|
//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;
|
if (myHand->getPlayerArray()[i]->getMyButton() == 2) smallBlindPosition = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +53,7 @@ void LocalRiver::riverRun() {
|
|||||||
bool allHighestSet = 1;
|
bool allHighestSet = 1;
|
||||||
|
|
||||||
// prfe, ob alle Sets gleich sind ( falls nicht, dann allHighestSet = 0 )
|
// 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(myHand->getPlayerArray()[i]->getMyActiveStatus() && myHand->getPlayerArray()[i]->getMyAction() != 1 && myHand->getPlayerArray()[i]->getMyAction() != 6) {
|
||||||
// cout << "Spieler " << i << " Set " << myHand->getPlayerArray()[i]->getMySet() << endl;
|
// cout << "Spieler " << i << " Set " << myHand->getPlayerArray()[i]->getMySet() << endl;
|
||||||
if(highestSet != myHand->getPlayerArray()[i]->getMySet()) { allHighestSet=0; }
|
if(highestSet != myHand->getPlayerArray()[i]->getMySet()) { allHighestSet=0; }
|
||||||
@@ -70,7 +71,7 @@ void LocalRiver::riverRun() {
|
|||||||
myHand->setActualRound(4);
|
myHand->setActualRound(4);
|
||||||
|
|
||||||
//Action lᅵchen und ActionButtons refresh
|
//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);
|
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
|
//Sets in den Pot verschieben und Sets = 0 und Pot-refresh
|
||||||
@@ -94,12 +95,12 @@ void LocalRiver::riverRun() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// nᅵhsten Spieler ermitteln
|
// 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);
|
} while(!(myHand->getPlayerArray()[playersTurn]->getMyActiveStatus()) || (myHand->getPlayerArray()[playersTurn]->getMyAction())==1 || (myHand->getPlayerArray()[playersTurn]->getMyAction())==6);
|
||||||
|
|
||||||
//Spieler-Position vor SmallBlind-Position ermitteln
|
//Spieler-Position vor SmallBlind-Position ermitteln
|
||||||
int activePlayerBeforeSmallBlind = smallBlindPosition;
|
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);
|
} while(!(myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyActiveStatus()) || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==1 || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==6);
|
||||||
|
|
||||||
myHand->getPlayerArray()[playersTurn]->setMyTurn(1);
|
myHand->getPlayerArray()[playersTurn]->setMyTurn(1);
|
||||||
@@ -138,7 +139,7 @@ void LocalRiver::postRiverRun() {
|
|||||||
// cout << myHand->getPlayerArray()[0]->getMyAverageSets() << endl;
|
// cout << myHand->getPlayerArray()[0]->getMyAverageSets() << endl;
|
||||||
|
|
||||||
//berechnen welcher Spieler gewonnen hat
|
//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;
|
// cout << "Spieler: " << i << " hat: " << myHand->getPlayerArray()[i]->getMyCardsValueInt() << endl;
|
||||||
|
|
||||||
@@ -154,7 +155,7 @@ void LocalRiver::postRiverRun() {
|
|||||||
// Aggressivität des human player ermitteln
|
// Aggressivität des human player ermitteln
|
||||||
// anzahl der player die möglichkeit haben am pot teilzuhaben
|
// anzahl der player die möglichkeit haben am pot teilzuhaben
|
||||||
int potPlayers = 0;
|
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) {
|
if(myHand->getPlayerArray()[i]->getMyActiveStatus() && myHand->getPlayerArray()[i]->getMyAction() != 1) {
|
||||||
potPlayers++;
|
potPlayers++;
|
||||||
}
|
}
|
||||||
@@ -202,14 +203,14 @@ void LocalRiver::distributePot() {
|
|||||||
/////////////////////
|
/////////////////////
|
||||||
|
|
||||||
// winnersArray erstellen -> hier werden die winner der jeweiligen Potverteilungsrunden eingetragen
|
// 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
|
// Anzahl der winner in einer Potverteilungsrunde
|
||||||
int winnersCounter = 0;
|
int winnersCounter = 0;
|
||||||
|
|
||||||
// dieses Array ermittelt wieviel jeder Spieler wᅵrend der gesamten BettingRound gesetzt hat
|
// dieses Array ermittelt wieviel jeder Spieler wᅵrend der gesamten BettingRound gesetzt hat
|
||||||
int *roundSetArray = new int[myHand->getGuiInterface()->getMaxQuantityPlayers()];
|
int *roundSetArray = new int[MAX_NUMBER_OF_PLAYERS];
|
||||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
// Standardwert fr nicht mehr aktive
|
// Standardwert fr nicht mehr aktive
|
||||||
roundSetArray[i] = 0;
|
roundSetArray[i] = 0;
|
||||||
// nur fr die Spieler ermitteln, die noch aktiv sind (inkl. der gefoldeten)
|
// 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
|
// 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;
|
int playerWantsPotCounter = 0;
|
||||||
|
|
||||||
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
// Standardwert
|
// Standardwert
|
||||||
cardsValueArray[i] = 0;
|
cardsValueArray[i] = 0;
|
||||||
if(myHand->getPlayerArray()[i]->getMyActiveStatus() && myHand->getPlayerArray()[i]->getMyAction() != 1) {
|
if(myHand->getPlayerArray()[i]->getMyActiveStatus() && myHand->getPlayerArray()[i]->getMyAction() != 1) {
|
||||||
@@ -255,7 +256,7 @@ void LocalRiver::distributePot() {
|
|||||||
highestCardsValueTemp = 0;
|
highestCardsValueTemp = 0;
|
||||||
|
|
||||||
// aktuellen highestCardsValueTemp berechnen, von denen die noch an der Potverteilung teilnehmen
|
// 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 ) {
|
if(cardsValueArray[i] > highestCardsValueTemp ) {
|
||||||
highestCardsValueTemp = myHand->getPlayerArray()[i]->getMyCardsValueInt();
|
highestCardsValueTemp = myHand->getPlayerArray()[i]->getMyCardsValueInt();
|
||||||
}
|
}
|
||||||
@@ -264,7 +265,7 @@ void LocalRiver::distributePot() {
|
|||||||
// zu Beginn der Potverteilungsrunde die Anzahl der winner auf 0 setzen
|
// zu Beginn der Potverteilungsrunde die Anzahl der winner auf 0 setzen
|
||||||
winnersCounter = 0;
|
winnersCounter = 0;
|
||||||
// Siegerposition und -anzahl von denen ermitteln, die noch an der Potverteilung teilnehmen
|
// 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 ) {
|
if(cardsValueArray[i] == highestCardsValueTemp ) {
|
||||||
winnersArray[winnersCounter] = i;
|
winnersArray[winnersCounter] = i;
|
||||||
winnersCounter++;
|
winnersCounter++;
|
||||||
@@ -291,7 +292,7 @@ void LocalRiver::distributePot() {
|
|||||||
// else {
|
// else {
|
||||||
|
|
||||||
// alle Spieler nacheinander durchgehen und prfen von wem man wieviel Geld aus dem Pot bekommt
|
// 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
|
// zuerst prfen ob ein gefoldeter Spieler was gesetzt hatte
|
||||||
if(i != winner && myHand->getPlayerArray()[i]->getMyAction() == 1) {
|
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
|
// 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
|
// prfen ob Spieler i zu den Winnern gehᅵt
|
||||||
playerIsWinner = 0;
|
playerIsWinner = 0;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#include "localturn.h"
|
#include "localturn.h"
|
||||||
|
#include <game_defs.h>
|
||||||
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@@ -27,7 +28,7 @@ LocalTurn::LocalTurn(HandInterface* bR, int id, int qP, int dP, int sB) : TurnIn
|
|||||||
{ int i;
|
{ int i;
|
||||||
|
|
||||||
//SmallBlind-Position ermitteln
|
//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;
|
if (myHand->getPlayerArray()[i]->getMyButton() == 2) smallBlindPosition = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,7 +54,7 @@ void LocalTurn::turnRun() {
|
|||||||
bool allHighestSet = 1;
|
bool allHighestSet = 1;
|
||||||
|
|
||||||
// prfe, ob alle Sets gleich sind ( falls nicht, dann allHighestSet = 0 )
|
// 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(myHand->getPlayerArray()[i]->getMyActiveStatus() && myHand->getPlayerArray()[i]->getMyAction() != 1 && myHand->getPlayerArray()[i]->getMyAction() != 6) {
|
||||||
// cout << "Spieler " << i << " Set " << myHand->getPlayerArray()[i]->getMySet() << endl;
|
// cout << "Spieler " << i << " Set " << myHand->getPlayerArray()[i]->getMySet() << endl;
|
||||||
if(highestSet != myHand->getPlayerArray()[i]->getMySet()) { allHighestSet=0; }
|
if(highestSet != myHand->getPlayerArray()[i]->getMySet()) { allHighestSet=0; }
|
||||||
@@ -71,7 +72,7 @@ void LocalTurn::turnRun() {
|
|||||||
myHand->setActualRound(3);
|
myHand->setActualRound(3);
|
||||||
|
|
||||||
//Action l�chen und ActionButtons refresh
|
//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);
|
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
|
//Sets in den Pot verschieben und Sets = 0 und Pot-refresh
|
||||||
@@ -95,12 +96,12 @@ void LocalTurn::turnRun() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// n�hsten Spieler ermitteln
|
// 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);
|
} while(!(myHand->getPlayerArray()[playersTurn]->getMyActiveStatus()) || (myHand->getPlayerArray()[playersTurn]->getMyAction())==1 || (myHand->getPlayerArray()[playersTurn]->getMyAction())==6);
|
||||||
|
|
||||||
//Spieler-Position vor SmallBlind-Position ermitteln
|
//Spieler-Position vor SmallBlind-Position ermitteln
|
||||||
int activePlayerBeforeSmallBlind = smallBlindPosition;
|
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);
|
} while(!(myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyActiveStatus()) || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==1 || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==6);
|
||||||
|
|
||||||
myHand->getPlayerArray()[playersTurn]->setMyTurn(1);
|
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;
|
actualHandID = 0;
|
||||||
|
|
||||||
for(i=0; i<myGui->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
playerArray[i] = 0;
|
playerArray[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ Game::Game(ConfigFile* c, GuiInterface* g, int qP, int sC, int sB, int gId) : my
|
|||||||
|
|
||||||
// Player erstellen
|
// Player erstellen
|
||||||
PlayerInterface *tempPlayer;
|
PlayerInterface *tempPlayer;
|
||||||
for(i=0; i<myGui->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
|
|
||||||
//Namen und Avatarpfad abfragen
|
//Namen und Avatarpfad abfragen
|
||||||
ostringstream myName;
|
ostringstream myName;
|
||||||
@@ -95,7 +95,7 @@ Game::~Game()
|
|||||||
actualHand = 0;
|
actualHand = 0;
|
||||||
|
|
||||||
PlayerInterface *tempPlayer;
|
PlayerInterface *tempPlayer;
|
||||||
for(i=0; i<myGui->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
tempPlayer = playerArray[i];
|
tempPlayer = playerArray[i];
|
||||||
playerArray[i] = 0;
|
playerArray[i] = 0;
|
||||||
delete tempPlayer;
|
delete tempPlayer;
|
||||||
@@ -107,7 +107,7 @@ void Game::startHand()
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
//eventuell vorhandene Hand l�chen
|
// eventuell vorhandene Hand löschen
|
||||||
if(actualHand) {
|
if(actualHand) {
|
||||||
delete actualHand;
|
delete actualHand;
|
||||||
actualHand = 0;
|
actualHand = 0;
|
||||||
@@ -120,18 +120,18 @@ void Game::startHand()
|
|||||||
if(actualHandID%handsBeforeRaiseSmallBLind == 0) actualSmallBlind *= 2;
|
if(actualHandID%handsBeforeRaiseSmallBLind == 0) actualSmallBlind *= 2;
|
||||||
|
|
||||||
//Spieler Action auf 0 setzen
|
//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);
|
playerArray[i]->setMyAction(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Spieler mit leerem Cash auf inactive setzen
|
// 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);
|
if(playerArray[i]->getMyCash() == 0) playerArray[i]->setMyActiveStatus(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Anzahl noch aktiver Spieler ermitteln
|
// Anzahl noch aktiver Spieler ermitteln
|
||||||
actualQuantityPlayers = 0;
|
actualQuantityPlayers = 0;
|
||||||
for(i=0; i<myGui->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
if(playerArray[i]->getMyActiveStatus() != 0) actualQuantityPlayers++;
|
if(playerArray[i]->getMyActiveStatus() != 0) actualQuantityPlayers++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ void Game::startHand()
|
|||||||
|
|
||||||
// Dealer-Button weiterschieben --> Achtung inactive
|
// Dealer-Button weiterschieben --> Achtung inactive
|
||||||
do {
|
do {
|
||||||
dealerPosition = (dealerPosition+1)%(myGui->getMaxQuantityPlayers());
|
dealerPosition = (dealerPosition+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||||
} while(!(playerArray[dealerPosition]->getMyActiveStatus()));
|
} while(!(playerArray[dealerPosition]->getMyActiveStatus()));
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
#include "game_defs.h"
|
||||||
|
|
||||||
class GuiInterface;
|
class GuiInterface;
|
||||||
class HandInterface;
|
class HandInterface;
|
||||||
class PlayerInterface;
|
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 setHand(HandInterface*) =0;
|
||||||
virtual void setSession(Session*) =0;
|
virtual void setSession(Session*) =0;
|
||||||
|
|
||||||
//get
|
|
||||||
virtual int getMaxQuantityPlayers() const=0;
|
|
||||||
|
|
||||||
//refresh-Funktionen
|
//refresh-Funktionen
|
||||||
virtual void refreshSet() const=0;
|
virtual void refreshSet() const=0;
|
||||||
virtual void refreshCash() 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::setHand(HandInterface *lh) { myW->setHand(lh); }
|
||||||
void GuiWrapper::setSession(Session *s) { myW->setSession(s); }
|
void GuiWrapper::setSession(Session *s) { myW->setSession(s); }
|
||||||
|
|
||||||
int GuiWrapper::getMaxQuantityPlayers() const { return myW->getMaxQuantityPlayers(); }
|
|
||||||
|
|
||||||
void GuiWrapper::refreshSet() const { myW->refreshSet(); }
|
void GuiWrapper::refreshSet() const { myW->refreshSet(); }
|
||||||
void GuiWrapper::refreshCash() const { myW->refreshCash(); }
|
void GuiWrapper::refreshCash() const { myW->refreshCash(); }
|
||||||
void GuiWrapper::refreshAction(int playerID, int playerAction) const { myW->refreshAction(playerID, playerAction); }
|
void GuiWrapper::refreshAction(int playerID, int playerAction) const { myW->refreshAction(playerID, playerAction); }
|
||||||
|
|||||||
@@ -47,8 +47,6 @@ public:
|
|||||||
void setHand(HandInterface*);
|
void setHand(HandInterface*);
|
||||||
void setSession(Session*);
|
void setSession(Session*);
|
||||||
|
|
||||||
int getMaxQuantityPlayers() const;
|
|
||||||
|
|
||||||
void refreshSet() const;
|
void refreshSet() const;
|
||||||
void refreshCash() const;
|
void refreshCash() const;
|
||||||
void refreshAction(int =-1, int =-1) const;
|
void refreshAction(int =-1, int =-1) const;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
#include "mainwindowimpl.h"
|
#include "mainwindowimpl.h"
|
||||||
|
#include <game_defs.h>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@@ -150,7 +151,7 @@ void Log::logNewGameHandMsg(int gameID, int handID) {
|
|||||||
|
|
||||||
//Aktive Spieler zählen
|
//Aktive Spieler zählen
|
||||||
int activePlayersCounter = 0;
|
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++;
|
if (myW->getActualHand()->getPlayerArray()[k]->getMyActiveStatus() == 1) activePlayersCounter++;
|
||||||
}
|
}
|
||||||
k = 0;
|
k = 0;
|
||||||
@@ -193,12 +194,12 @@ void Log::logNewGameHandMsg(int gameID, int handID) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
stream << "</br>BLINDS: ";
|
stream << "</br>BLINDS: ";
|
||||||
for(i=0; i<myW->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
|
|
||||||
j = 0;
|
j = 0;
|
||||||
//Aktive Spieler zählen
|
//Aktive Spieler zählen
|
||||||
int activePlayersCounter = 0;
|
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 (myW->getActualHand()->getPlayerArray()[k]->getMyAction() != 1 && myW->getActualHand()->getPlayerArray()[k]->getMyActiveStatus() == 1) activePlayersCounter++;
|
||||||
}
|
}
|
||||||
if(activePlayersCounter < 3) { j=1; }
|
if(activePlayersCounter < 3) { j=1; }
|
||||||
@@ -206,10 +207,10 @@ void Log::logNewGameHandMsg(int gameID, int handID) {
|
|||||||
// cout << activePlayersCounter << endl;
|
// cout << activePlayersCounter << endl;
|
||||||
// cout << (i+myW->getActualHand()->getDealerPosition()+j)%5 << endl;
|
// cout << (i+myW->getActualHand()->getDealerPosition()+j)%5 << endl;
|
||||||
|
|
||||||
switch (myW->getActualHand()->getPlayerArray()[(i+myW->getActualHand()->getDealerPosition()+j)%myW->getMaxQuantityPlayers()]->getMyButton()) {
|
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)%myW->getMaxQuantityPlayers()]->getMyName().c_str())+" ("+QString::number(myW->getActualHand()->getPlayerArray()[(i+myW->getActualHand()->getDealerPosition()+j)%myW->getMaxQuantityPlayers()]->getMySet(),10)+"$), ";
|
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;
|
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;
|
break;
|
||||||
default :;
|
default :;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,16 +45,11 @@
|
|||||||
#define FORMATLEFT(X) "<p align='center'>(X)"
|
#define FORMATLEFT(X) "<p align='center'>(X)"
|
||||||
#define FORMATRIGHT(X) "(X)</p>"
|
#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;
|
using namespace std;
|
||||||
|
|
||||||
mainWindowImpl::mainWindowImpl(QMainWindow *parent)
|
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;
|
int i;
|
||||||
|
|
||||||
@@ -412,7 +407,7 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent)
|
|||||||
label_Pot->setFont(tmpFont2);
|
label_Pot->setFont(tmpFont2);
|
||||||
|
|
||||||
tmpFont2.setPixelSize(10);
|
tmpFont2.setPixelSize(10);
|
||||||
for (i=0; i<maxQuantityPlayers; i++) {
|
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
|
|
||||||
cashTopLabelArray[i]->setFont(tmpFont2);
|
cashTopLabelArray[i]->setFont(tmpFont2);
|
||||||
cashLabelArray[i]->setFont(tmpFont2);
|
cashLabelArray[i]->setFont(tmpFont2);
|
||||||
@@ -421,13 +416,13 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent)
|
|||||||
spinBox_set->setFont(tmpFont2);
|
spinBox_set->setFont(tmpFont2);
|
||||||
|
|
||||||
tmpFont2.setPixelSize(12);
|
tmpFont2.setPixelSize(12);
|
||||||
for (i=0; i<maxQuantityPlayers; i++) {
|
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
|
|
||||||
setLabelArray[i]->setFont(tmpFont2);
|
setLabelArray[i]->setFont(tmpFont2);
|
||||||
}
|
}
|
||||||
|
|
||||||
tmpFont2.setPixelSize(13);
|
tmpFont2.setPixelSize(13);
|
||||||
for (i=0; i<maxQuantityPlayers; i++) {
|
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
|
|
||||||
playerNameLabelArray[i]->setFont(tmpFont2);
|
playerNameLabelArray[i]->setFont(tmpFont2);
|
||||||
}
|
}
|
||||||
@@ -448,7 +443,7 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent)
|
|||||||
|
|
||||||
//Widgets Grafiken per Stylesheets setzen
|
//Widgets Grafiken per Stylesheets setzen
|
||||||
//Groupbox Background
|
//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) }");
|
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
|
//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
|
//ShortCuts
|
||||||
@@ -741,7 +736,7 @@ void mainWindowImpl::callSettingsDialog() {
|
|||||||
|
|
||||||
int i,j;
|
int i,j;
|
||||||
|
|
||||||
for (i=1; i<maxQuantityPlayers; i++ ) {
|
for (i=1; i<MAX_NUMBER_OF_PLAYERS; i++ ) {
|
||||||
for ( j=0; j<=1; j++ ) {
|
for ( j=0; j<=1; j++ ) {
|
||||||
if (holeCardsArray[i][j]->getIsFlipside()) {
|
if (holeCardsArray[i][j]->getIsFlipside()) {
|
||||||
holeCardsArray[i][j]->setPixmap(*flipside, TRUE);
|
holeCardsArray[i][j]->setPixmap(*flipside, TRUE);
|
||||||
@@ -765,7 +760,7 @@ void mainWindowImpl::setLog(Log* l) { myLog = l; }
|
|||||||
void mainWindowImpl::refreshSet() {
|
void mainWindowImpl::refreshSet() {
|
||||||
|
|
||||||
int i;
|
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("");
|
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>");
|
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;
|
int k;
|
||||||
//Aktive Spieler zählen
|
//Aktive Spieler zählen
|
||||||
int activePlayersCounter = 0;
|
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++;
|
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(actualHand->getPlayerArray()[i]->getMyActiveStatus()) {
|
||||||
if(activePlayersCounter > 2) {
|
if(activePlayersCounter > 2) {
|
||||||
if (actualHand->getPlayerArray()[i]->getMyButton()==1) {
|
if (actualHand->getPlayerArray()[i]->getMyButton()==1) {
|
||||||
@@ -810,7 +805,7 @@ void mainWindowImpl::refreshButton() {
|
|||||||
void mainWindowImpl::refreshPlayerName() {
|
void mainWindowImpl::refreshPlayerName() {
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
for (i=0; i<maxQuantityPlayers; i++) {
|
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus()) {
|
if(actualHand->getPlayerArray()[i]->getMyActiveStatus()) {
|
||||||
playerNameLabelArray[i]->setText(QString::fromUtf8(actualHand->getPlayerArray()[i]->getMyName().c_str()));
|
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");
|
QPixmap onePix(":/graphics/resources/graphics/1px.png");
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i=0; i<maxQuantityPlayers; i++) {
|
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus()) {
|
if(actualHand->getPlayerArray()[i]->getMyActiveStatus()) {
|
||||||
|
|
||||||
if(!i) {
|
if(!i) {
|
||||||
@@ -864,7 +859,7 @@ void mainWindowImpl::refreshAction(int playerID, int playerAction) {
|
|||||||
if(playerID == -1 || playerAction == -1) {
|
if(playerID == -1 || playerAction == -1) {
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
for (i=0; i<maxQuantityPlayers; i++) {
|
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
|
|
||||||
//if no action --> clear Pixmap
|
//if no action --> clear Pixmap
|
||||||
if(actualHand->getPlayerArray()[i]->getMyAction() == 0) {
|
if(actualHand->getPlayerArray()[i]->getMyAction() == 0) {
|
||||||
@@ -913,7 +908,7 @@ void mainWindowImpl::refreshAction(int playerID, int playerAction) {
|
|||||||
void mainWindowImpl::refreshCash() {
|
void mainWindowImpl::refreshCash() {
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
for (i=0; i<maxQuantityPlayers; i++) {
|
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus()) {
|
if(actualHand->getPlayerArray()[i]->getMyActiveStatus()) {
|
||||||
|
|
||||||
cashLabelArray[i]->setText(QString::number(actualHand->getPlayerArray()[i]->getMyCash(),10)+" $");
|
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) {
|
if(playerID == -1 || status == -1) {
|
||||||
|
|
||||||
int i,j;
|
int i,j;
|
||||||
for (i=0; i<maxQuantityPlayers; i++) {
|
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
|
|
||||||
if(actualHand->getPlayerArray()[i]->getMyTurn()) {
|
if(actualHand->getPlayerArray()[i]->getMyTurn()) {
|
||||||
//Groupbox glow wenn der Spiele dran ist.
|
//Groupbox glow wenn der Spiele dran ist.
|
||||||
@@ -1061,7 +1056,7 @@ void mainWindowImpl::dealHoleCards() {
|
|||||||
|
|
||||||
// Karten der Gegner austeilen
|
// Karten der Gegner austeilen
|
||||||
int i, j;
|
int i, j;
|
||||||
for(i=1; i<maxQuantityPlayers; i++) {
|
for(i=1; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
actualHand->getPlayerArray()[i]->getMyCards(tempCardsIntArray);
|
actualHand->getPlayerArray()[i]->getMyCards(tempCardsIntArray);
|
||||||
for(j=0; j<2; j++) {
|
for(j=0; j<2; j++) {
|
||||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus()) {
|
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
|
//Aktive Spieler zählen --> wenn nur noch einer nicht-folded dann keine Karten umdrehen
|
||||||
int activePlayersCounter = 0;
|
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++;
|
if (actualHand->getPlayerArray()[i]->getMyAction() != 1 && actualHand->getPlayerArray()[i]->getMyActiveStatus() == 1) activePlayersCounter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1648,7 +1643,7 @@ void mainWindowImpl::postRiverRunAnimation2() {
|
|||||||
|
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
for(i=0; i<maxQuantityPlayers; i++) {
|
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
actualHand->getPlayerArray()[i]->getMyCards(tempCardsIntArray);
|
actualHand->getPlayerArray()[i]->getMyCards(tempCardsIntArray);
|
||||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus() && actualHand->getPlayerArray()[i]->getMyAction() != 1) {
|
if(actualHand->getPlayerArray()[i]->getMyActiveStatus() && actualHand->getPlayerArray()[i]->getMyAction() != 1) {
|
||||||
if(i) {
|
if(i) {
|
||||||
@@ -1675,7 +1670,7 @@ void mainWindowImpl::postRiverRunAnimation2() {
|
|||||||
int tempCardsIntArray[2];
|
int tempCardsIntArray[2];
|
||||||
|
|
||||||
int i, j;
|
int i, j;
|
||||||
for(i=0; i<maxQuantityPlayers; i++) {
|
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
actualHand->getPlayerArray()[i]->getMyCards(tempCardsIntArray);
|
actualHand->getPlayerArray()[i]->getMyCards(tempCardsIntArray);
|
||||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus() && actualHand->getPlayerArray()[i]->getMyAction() != 1) {
|
if(actualHand->getPlayerArray()[i]->getMyActiveStatus() && actualHand->getPlayerArray()[i]->getMyAction() != 1) {
|
||||||
if(i) {
|
if(i) {
|
||||||
@@ -1698,7 +1693,7 @@ void mainWindowImpl::postRiverRunAnimation2() {
|
|||||||
else {
|
else {
|
||||||
int tempCardsIntArray[2];
|
int tempCardsIntArray[2];
|
||||||
int i;
|
int i;
|
||||||
for(i=0; i<maxQuantityPlayers; i++) {
|
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
actualHand->getPlayerArray()[i]->getMyCards(tempCardsIntArray);
|
actualHand->getPlayerArray()[i]->getMyCards(tempCardsIntArray);
|
||||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus() && actualHand->getPlayerArray()[i]->getMyAction() != 1) {
|
if(actualHand->getPlayerArray()[i]->getMyActiveStatus() && actualHand->getPlayerArray()[i]->getMyAction() != 1) {
|
||||||
|
|
||||||
@@ -1718,7 +1713,7 @@ void mainWindowImpl::postRiverRunAnimation3() {
|
|||||||
// cout << "Neue Runde" << endl;
|
// cout << "Neue Runde" << endl;
|
||||||
|
|
||||||
//Alle Winner erhellen und "Winner" schreiben
|
//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() ) {
|
if(actualHand->getPlayerArray()[i]->getMyActiveStatus() && actualHand->getPlayerArray()[i]->getMyAction() != 1 && actualHand->getPlayerArray()[i]->getMyCardsValueInt() == actualHand->getRiver()->getHighestCardsValue() ) {
|
||||||
|
|
||||||
// QPalette tempPalette = groupBoxArray[i]->palette();
|
// 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
|
//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;
|
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;
|
// cout << (actualHand->getPlayerArray()[i]->getMyBestHandPosition())[j] << endl;
|
||||||
if ((actualHand->getPlayerArray()[i]->getMyBestHandPosition())[j] == 0 ) { index0 = FALSE; }
|
if ((actualHand->getPlayerArray()[i]->getMyBestHandPosition())[j] == 0 ) { index0 = FALSE; }
|
||||||
}
|
}
|
||||||
if (index0) { holeCardsArray[i][0]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index0" << endl;*/}
|
if (index0) { holeCardsArray[i][0]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index0" << endl;*/}
|
||||||
//index 1 testen
|
//index 1 testen
|
||||||
bool index1 = TRUE;
|
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 ((actualHand->getPlayerArray()[i]->getMyBestHandPosition())[j] == 1 ) { index1 = FALSE; }
|
||||||
}
|
}
|
||||||
if (index1) { holeCardsArray[i][1]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index1" << endl;*/}
|
if (index1) { holeCardsArray[i][1]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index1" << endl;*/}
|
||||||
//index 2 testen
|
//index 2 testen
|
||||||
bool index2 = TRUE;
|
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 ((actualHand->getPlayerArray()[i]->getMyBestHandPosition())[j] == 2 ) { index2 = FALSE; }
|
||||||
}
|
}
|
||||||
if (index2) { boardCardsArray[0]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index2" << endl;*/}
|
if (index2) { boardCardsArray[0]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index2" << endl;*/}
|
||||||
//index 3 testen
|
//index 3 testen
|
||||||
bool index3 = TRUE;
|
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 ((actualHand->getPlayerArray()[i]->getMyBestHandPosition())[j] == 3 ) { index3 = FALSE; }
|
||||||
}
|
}
|
||||||
if (index3) { boardCardsArray[1]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index3" << endl;*/}
|
if (index3) { boardCardsArray[1]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index3" << endl;*/}
|
||||||
//index 4 testen
|
//index 4 testen
|
||||||
bool index4 = TRUE;
|
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 ((actualHand->getPlayerArray()[i]->getMyBestHandPosition())[j] == 4 ) { index4 = FALSE; }
|
||||||
}
|
}
|
||||||
if (index4) { boardCardsArray[2]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index4" << endl;*/}
|
if (index4) { boardCardsArray[2]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index4" << endl;*/}
|
||||||
//index 5 testen
|
//index 5 testen
|
||||||
bool index5 = TRUE;
|
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 ((actualHand->getPlayerArray()[i]->getMyBestHandPosition())[j] == 5 ) { index5 = FALSE; }
|
||||||
}
|
}
|
||||||
if (index5) { boardCardsArray[3]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index5" << endl;*/}
|
if (index5) { boardCardsArray[3]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index5" << endl;*/}
|
||||||
//index 6 testen
|
//index 6 testen
|
||||||
bool index6 = TRUE;
|
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 ((actualHand->getPlayerArray()[i]->getMyBestHandPosition())[j] == 6 ) { index6 = FALSE; }
|
||||||
}
|
}
|
||||||
if (index6) { boardCardsArray[4]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index6" << endl;*/}
|
if (index6) { boardCardsArray[4]->startFadeOut(guiGameSpeed); /*cout << "Fade Out index6" << endl;*/}
|
||||||
@@ -1818,7 +1813,7 @@ void mainWindowImpl::postRiverRunAnimation5() {
|
|||||||
|
|
||||||
label_Pot->setText("");
|
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() ) {
|
if(actualHand->getPlayerArray()[i]->getMyActiveStatus() && actualHand->getPlayerArray()[i]->getMyAction() != 1 && actualHand->getPlayerArray()[i]->getMyCardsValueInt() == actualHand->getRiver()->getHighestCardsValue() ) {
|
||||||
|
|
||||||
cashTopLabelArray[i]->setText("");
|
cashTopLabelArray[i]->setText("");
|
||||||
@@ -1828,7 +1823,7 @@ void mainWindowImpl::postRiverRunAnimation5() {
|
|||||||
else {
|
else {
|
||||||
label_Pot->setText("<span style='font-weight:bold'>Pot</span>");
|
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() ) {
|
if(actualHand->getPlayerArray()[i]->getMyActiveStatus() && actualHand->getPlayerArray()[i]->getMyAction() != 1 && actualHand->getPlayerArray()[i]->getMyCardsValueInt() == actualHand->getRiver()->getHighestCardsValue() ) {
|
||||||
|
|
||||||
cashTopLabelArray[i]->setText("<b>Cash:</b>");
|
cashTopLabelArray[i]->setText("<b>Cash:</b>");
|
||||||
@@ -1888,7 +1883,7 @@ void mainWindowImpl::flipHolecardsAllIn() {
|
|||||||
if(!flipHolecardsAllInAlreadyDone) {
|
if(!flipHolecardsAllInAlreadyDone) {
|
||||||
//Aktive Spieler zählen --> wenn nur noch einer nicht-folded dann keine Karten umdrehen
|
//Aktive Spieler zählen --> wenn nur noch einer nicht-folded dann keine Karten umdrehen
|
||||||
int activePlayersCounter = 0;
|
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++;
|
if (actualHand->getPlayerArray()[i]->getMyAction() != 1 && actualHand->getPlayerArray()[i]->getMyActiveStatus() == 1) activePlayersCounter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1903,7 +1898,7 @@ void mainWindowImpl::flipHolecardsAllIn() {
|
|||||||
|
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
for(i=0; i<maxQuantityPlayers; i++) {
|
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
actualHand->getPlayerArray()[i]->getMyCards(tempCardsIntArray);
|
actualHand->getPlayerArray()[i]->getMyCards(tempCardsIntArray);
|
||||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus() && actualHand->getPlayerArray()[i]->getMyAction() != 1) {
|
if(actualHand->getPlayerArray()[i]->getMyActiveStatus() && actualHand->getPlayerArray()[i]->getMyAction() != 1) {
|
||||||
if(i) {
|
if(i) {
|
||||||
@@ -1930,7 +1925,7 @@ void mainWindowImpl::flipHolecardsAllIn() {
|
|||||||
int temp2CardsIntArray[2];
|
int temp2CardsIntArray[2];
|
||||||
|
|
||||||
int i, j;
|
int i, j;
|
||||||
for(i=0; i<maxQuantityPlayers; i++) {
|
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
actualHand->getPlayerArray()[i]->getMyCards(temp2CardsIntArray);
|
actualHand->getPlayerArray()[i]->getMyCards(temp2CardsIntArray);
|
||||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus() && actualHand->getPlayerArray()[i]->getMyAction() != 1) {
|
if(actualHand->getPlayerArray()[i]->getMyActiveStatus() && actualHand->getPlayerArray()[i]->getMyAction() != 1) {
|
||||||
if(i) {
|
if(i) {
|
||||||
@@ -1993,7 +1988,7 @@ void mainWindowImpl::nextRoundCleanGui() {
|
|||||||
boardCardsArray[i]->setFadeOutAction(FALSE);
|
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);}
|
for ( j=0; j<=1; j++ ) { holeCardsArray[i][j]->setFadeOutAction(FALSE);}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,9 +28,10 @@
|
|||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
|
|
||||||
#include "handinterface.h"
|
#include "handinterface.h"
|
||||||
|
#include "game_defs.h"
|
||||||
|
|
||||||
class Game;
|
|
||||||
class Session;
|
class Session;
|
||||||
|
class Game;
|
||||||
class Log;
|
class Log;
|
||||||
class ConfigFile;
|
class ConfigFile;
|
||||||
|
|
||||||
@@ -61,8 +62,6 @@ public:
|
|||||||
void setSession(Session*);
|
void setSession(Session*);
|
||||||
void setLog(Log*);
|
void setLog(Log*);
|
||||||
|
|
||||||
int getMaxQuantityPlayers() const { return maxQuantityPlayers; }
|
|
||||||
|
|
||||||
void setActualHand(HandInterface* theValue) { actualHand = theValue;}
|
void setActualHand(HandInterface* theValue) { actualHand = theValue;}
|
||||||
HandInterface* getActualHand() const { return actualHand;}
|
HandInterface* getActualHand() const { return actualHand;}
|
||||||
|
|
||||||
@@ -225,7 +224,7 @@ private:
|
|||||||
MyCardsPixmapLabel *pixmapLabel_card6b;
|
MyCardsPixmapLabel *pixmapLabel_card6b;
|
||||||
//Timer
|
//Timer
|
||||||
QTimer *potDistributeTimer;
|
QTimer *potDistributeTimer;
|
||||||
QTimer *timer;
|
QTimer *timer;
|
||||||
QTimer *dealFlopCards0Timer;
|
QTimer *dealFlopCards0Timer;
|
||||||
QTimer *dealFlopCards1Timer;
|
QTimer *dealFlopCards1Timer;
|
||||||
QTimer *dealFlopCards2Timer;
|
QTimer *dealFlopCards2Timer;
|
||||||
@@ -258,17 +257,17 @@ private:
|
|||||||
QTimer *postRiverRunAnimation6Timer;
|
QTimer *postRiverRunAnimation6Timer;
|
||||||
|
|
||||||
QWidget *userWidgetsArray[4];
|
QWidget *userWidgetsArray[4];
|
||||||
QLabel *buttonLabelArray[7];
|
QLabel *buttonLabelArray[MAX_NUMBER_OF_PLAYERS];
|
||||||
QLabel *cashLabelArray[7];
|
QLabel *cashLabelArray[MAX_NUMBER_OF_PLAYERS];
|
||||||
QLabel *cashTopLabelArray[7];
|
QLabel *cashTopLabelArray[MAX_NUMBER_OF_PLAYERS];
|
||||||
QLabel *setLabelArray[7];
|
QLabel *setLabelArray[MAX_NUMBER_OF_PLAYERS];
|
||||||
QLabel *actionLabelArray[7];
|
QLabel *actionLabelArray[MAX_NUMBER_OF_PLAYERS];
|
||||||
QLabel *playerNameLabelArray[7];
|
QLabel *playerNameLabelArray[MAX_NUMBER_OF_PLAYERS];
|
||||||
QLabel *playerAvatarLabelArray[7];
|
QLabel *playerAvatarLabelArray[MAX_NUMBER_OF_PLAYERS];
|
||||||
|
|
||||||
QGroupBox *groupBoxArray[7];
|
QGroupBox *groupBoxArray[MAX_NUMBER_OF_PLAYERS];
|
||||||
MyCardsPixmapLabel *boardCardsArray[5];
|
MyCardsPixmapLabel *boardCardsArray[5];
|
||||||
MyCardsPixmapLabel *holeCardsArray[7][2];
|
MyCardsPixmapLabel *holeCardsArray[MAX_NUMBER_OF_PLAYERS][2];
|
||||||
|
|
||||||
QPixmap *flipside;
|
QPixmap *flipside;
|
||||||
|
|
||||||
@@ -279,8 +278,6 @@ private:
|
|||||||
createNetworkGameDialogImpl *myCreateNetworkGameDialog;
|
createNetworkGameDialogImpl *myCreateNetworkGameDialog;
|
||||||
waitForServerToStartGameDialogImpl *myWaitingForServerGameDialog;
|
waitForServerToStartGameDialogImpl *myWaitingForServerGameDialog;
|
||||||
|
|
||||||
int maxQuantityPlayers;
|
|
||||||
|
|
||||||
int distributePotAnimCounter;
|
int distributePotAnimCounter;
|
||||||
|
|
||||||
//Speed
|
//Speed
|
||||||
|
|||||||
Reference in New Issue
Block a user