myW removed from engine classes
This commit is contained in:
@@ -20,23 +20,24 @@
|
|||||||
#ifndef BOARDINTERFACE_H
|
#ifndef BOARDINTERFACE_H
|
||||||
#define BOARDINTERFACE_H
|
#define BOARDINTERFACE_H
|
||||||
|
|
||||||
class BoardInterface{
|
class BoardInterface {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual ~BoardInterface();
|
virtual ~BoardInterface();
|
||||||
|
|
||||||
// virtual void setPlayer(LocalPlayer**);
|
|
||||||
// virtual void setHand(LocalHand*);
|
|
||||||
//
|
//
|
||||||
// void setMyCards(int* theValue) { int i; for(i=0; i<5; i++) myCards[i] = theValue[i]; }
|
// virtual void setPlayer(LocalPlayer**) =0;
|
||||||
// void getMyCards(int* theValue) { int i; for(i=0; i<5; i++) theValue[i] = myCards[i]; }
|
// virtual void setHand(LocalHand*) =0;
|
||||||
//
|
//
|
||||||
// int getPot() const { return pot;}
|
// virtual void setMyCards(int* theValue) =0;
|
||||||
// void setPot(int theValue) { pot = theValue;}
|
// virtual void getMyCards(int* theValue) =0;
|
||||||
// int getSets() const { return sets; }
|
|
||||||
//
|
//
|
||||||
// void collectSets();
|
// virtual int getPot() const=0;
|
||||||
// void collectPot();
|
// virtual void setPot(int theValue) =0;
|
||||||
|
// virtual int getSets() const=0;
|
||||||
|
//
|
||||||
|
// virtual void collectSets() const=0;
|
||||||
|
// virtual void collectPot() const=0;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
+11
-15
@@ -25,18 +25,18 @@
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
Game::Game(mainWindowImpl *w, GuiInterface* g, int qP, int sC, int sB) : myW(w), myGui(g), actualHand(0), actualBoard(0), startQuantityPlayers(qP), startCash(sC), startSmallBlind(sB), actualQuantityPlayers(qP), actualSmallBlind(sB), actualHandID(0), dealerPosition(0)
|
Game::Game(GuiInterface* g, int qP, int sC, int sB) : myGui(g), actualHand(0), actualBoard(0), startQuantityPlayers(qP), startCash(sC), startSmallBlind(sB), actualQuantityPlayers(qP), actualSmallBlind(sB), actualHandID(0), dealerPosition(0)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for(i=0; i<myW->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myGui->getMaxQuantityPlayers(); i++) {
|
||||||
playerArray[i] = 0;
|
playerArray[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// myEngine = new EngineWrapper();
|
// myEngine = new EngineWrapper();
|
||||||
|
|
||||||
|
|
||||||
myW->setGame(this);
|
myGui->setGame(this);
|
||||||
|
|
||||||
// myGui->setGameEngine(myEngine);
|
// myGui->setGameEngine(myEngine);
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ Game::Game(mainWindowImpl *w, GuiInterface* g, int qP, int sC, int sB) : myW(w),
|
|||||||
|
|
||||||
// Player erstellen
|
// Player erstellen
|
||||||
LocalPlayer *tempPlayer;
|
LocalPlayer *tempPlayer;
|
||||||
for(i=0; i<myW->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myGui->getMaxQuantityPlayers(); i++) {
|
||||||
tempPlayer = new LocalPlayer(actualBoard, i, startCash, startQuantityPlayers > i, 0);
|
tempPlayer = new LocalPlayer(actualBoard, i, startCash, startQuantityPlayers > i, 0);
|
||||||
playerArray[i] = tempPlayer;
|
playerArray[i] = tempPlayer;
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@ Game::~Game()
|
|||||||
actualHand = 0;
|
actualHand = 0;
|
||||||
|
|
||||||
LocalPlayer *tempPlayer;
|
LocalPlayer *tempPlayer;
|
||||||
for(i=0; i<myW->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myGui->getMaxQuantityPlayers(); i++) {
|
||||||
tempPlayer = playerArray[i];
|
tempPlayer = playerArray[i];
|
||||||
playerArray[i] = 0;
|
playerArray[i] = 0;
|
||||||
delete tempPlayer;
|
delete tempPlayer;
|
||||||
@@ -99,31 +99,27 @@ void Game::startHand()
|
|||||||
if(actualHandID%9 == 0) actualSmallBlind *= 2;
|
if(actualHandID%9 == 0) actualSmallBlind *= 2;
|
||||||
|
|
||||||
//Spieler Action auf 0 setzen
|
//Spieler Action auf 0 setzen
|
||||||
for(i=0; i<myW->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myGui->getMaxQuantityPlayers(); 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<myW->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myGui->getMaxQuantityPlayers(); i++) {
|
||||||
if(playerArray[i]->getMyCash() == 0) playerArray[i]->setMyActiveStatus(0);
|
if(playerArray[i]->getMyCash() == 0) playerArray[i]->setMyActiveStatus(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Spiel-Men disablen
|
|
||||||
// myW->actionNewGame->setDisabled(TRUE);
|
|
||||||
|
|
||||||
|
|
||||||
// Hand erstellen
|
// Hand erstellen
|
||||||
actualHand = new LocalHand(myW, myGui, actualBoard, playerArray, actualHandID, actualQuantityPlayers, dealerPosition, actualSmallBlind, startCash);
|
actualHand = new LocalHand(myGui, actualBoard, playerArray, actualHandID, actualQuantityPlayers, dealerPosition, actualSmallBlind, startCash);
|
||||||
|
|
||||||
//GUI bereinigen
|
//GUI bereinigen
|
||||||
myW->nextRoundCleanGui();
|
myGui->nextRoundCleanGui();
|
||||||
|
|
||||||
//Spielernamen schreiben
|
//Spielernamen schreiben
|
||||||
myW->refreshPlayerName();
|
myGui->refreshPlayerName();
|
||||||
|
|
||||||
// Dealer-Button weiterschieben --> Achtung inactive
|
// Dealer-Button weiterschieben --> Achtung inactive
|
||||||
do {
|
do {
|
||||||
dealerPosition = (dealerPosition+1)%(myW->getMaxQuantityPlayers());
|
dealerPosition = (dealerPosition+1)%(myGui->getMaxQuantityPlayers());
|
||||||
} while(!(playerArray[dealerPosition]->getMyActiveStatus()));
|
} while(!(playerArray[dealerPosition]->getMyActiveStatus()));
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-3
@@ -24,7 +24,6 @@
|
|||||||
|
|
||||||
class LocalHand;
|
class LocalHand;
|
||||||
class LocalBoard;
|
class LocalBoard;
|
||||||
class mainWindowImpl;
|
|
||||||
class GuiInterface;
|
class GuiInterface;
|
||||||
class LocalPlayer;
|
class LocalPlayer;
|
||||||
|
|
||||||
@@ -32,7 +31,7 @@ class LocalPlayer;
|
|||||||
class Game {
|
class Game {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Game(mainWindowImpl*, GuiInterface*, int, int, int);
|
Game(GuiInterface*, int, int, int);
|
||||||
|
|
||||||
~Game();
|
~Game();
|
||||||
|
|
||||||
@@ -66,7 +65,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
mainWindowImpl *myW;
|
|
||||||
GuiInterface *myGui;
|
GuiInterface *myGui;
|
||||||
LocalHand *actualHand;
|
LocalHand *actualHand;
|
||||||
LocalBoard *actualBoard;
|
LocalBoard *actualBoard;
|
||||||
|
|||||||
+53
-3
@@ -23,21 +23,46 @@
|
|||||||
// #include <iostream>
|
// #include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include "session.h"
|
||||||
|
#include "game.h"
|
||||||
|
|
||||||
|
//wird nach Einbau der EngineInterfaces zu handinterface.h
|
||||||
|
#include "localhand.h"
|
||||||
|
|
||||||
|
|
||||||
class GuiInterface{
|
class GuiInterface{
|
||||||
public:
|
public:
|
||||||
virtual ~GuiInterface();
|
virtual ~GuiInterface();
|
||||||
|
|
||||||
|
|
||||||
virtual void showPlayerActionLogMsg(std::string playName, int &action, int &setValue) const=0;
|
//wird nach Einbau der EngineInterfaces umbenannt in setGameInterface und cp.
|
||||||
|
virtual void setGame(Game*) =0;
|
||||||
|
virtual void setHand(LocalHand*) =0;
|
||||||
|
virtual void setSession(Session*) =0;
|
||||||
|
//
|
||||||
|
virtual int getMaxQuantityPlayers() const=0;
|
||||||
|
|
||||||
|
//refresh-Funktionen
|
||||||
virtual void refreshSet() const=0;
|
virtual void refreshSet() const=0;
|
||||||
virtual void refreshChangePlayer() const=0;
|
virtual void refreshChangePlayer() const=0;
|
||||||
|
virtual void refreshPot() const=0;
|
||||||
|
virtual void refreshGroupbox() const=0;
|
||||||
|
virtual void refreshAll() const=0;
|
||||||
|
virtual void refreshPlayerName() const=0;
|
||||||
|
|
||||||
|
// virtual void refreshButton() const=0;
|
||||||
|
|
||||||
|
// virtual void refreshAction() const=0;
|
||||||
|
// virtual void refreshCash() const=0;
|
||||||
|
|
||||||
|
// // Karten-Funktionen
|
||||||
|
virtual void dealHoleCards() const=0;
|
||||||
virtual void dealFlopCards() const=0;
|
virtual void dealFlopCards() const=0;
|
||||||
virtual void dealTurnCard() const=0;
|
virtual void dealTurnCard() const=0;
|
||||||
virtual void dealRiverCard() const=0;
|
virtual void dealRiverCard() const=0;
|
||||||
|
|
||||||
|
virtual void highlightRoundLabel(std::string) const=0;
|
||||||
|
|
||||||
virtual void nextPlayerAnimation() const=0;
|
virtual void nextPlayerAnimation() const=0;
|
||||||
|
|
||||||
virtual void preflopAnimation1() const=0;
|
virtual void preflopAnimation1() const=0;
|
||||||
@@ -53,8 +78,33 @@ public:
|
|||||||
virtual void riverAnimation2() const=0;
|
virtual void riverAnimation2() const=0;
|
||||||
|
|
||||||
virtual void postRiverAnimation1() const=0;
|
virtual void postRiverAnimation1() const=0;
|
||||||
|
virtual void postRiverRunAnimation1() const=0;
|
||||||
// virtual void postRiverAnimation2() const=0;
|
// virtual void postRiverAnimation2() const=0;
|
||||||
|
|
||||||
|
// virtual void handSwitchRounds() const=0;
|
||||||
|
//
|
||||||
|
// virtual void startNewHand() const=0;
|
||||||
|
virtual void nextRoundCleanGui() const=0;
|
||||||
|
//
|
||||||
|
// virtual void userWidgetsBackgroudColor() const=0;
|
||||||
|
// virtual void timerBlockerFalse() const=0;
|
||||||
|
virtual void meInAction() const=0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//log.cpp
|
||||||
|
virtual void showPlayerActionLogMsg(std::string playName, int action, int setValue) const=0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+22
-3
@@ -44,18 +44,27 @@ GuiWrapper::~GuiWrapper()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GuiWrapper::setGame(Game *g) { myW->setGame(g); }
|
||||||
|
void GuiWrapper::setHand(LocalHand *lh) { myW->setHand(lh); }
|
||||||
|
void GuiWrapper::setSession(Session *s) { myW->setSession(s); }
|
||||||
|
|
||||||
void GuiWrapper::showPlayerActionLogMsg(string playerName, int &action, int &setValue) const { myLog->showPlayerActionLogMsg(playerName, action, setValue);
|
int GuiWrapper::getMaxQuantityPlayers() const { return myW->getMaxQuantityPlayers(); }
|
||||||
}
|
|
||||||
|
|
||||||
void GuiWrapper::refreshSet() const { myW->refreshSet(); }
|
void GuiWrapper::refreshSet() const { myW->refreshSet(); }
|
||||||
void GuiWrapper::refreshChangePlayer() const { myW->refreshChangePlayer(); }
|
void GuiWrapper::refreshChangePlayer() const { myW->refreshChangePlayer(); }
|
||||||
|
void GuiWrapper::refreshAll() const { myW->refreshAll(); }
|
||||||
|
void GuiWrapper::refreshPot() const { myW->refreshPot(); }
|
||||||
|
void GuiWrapper::refreshGroupbox() const { myW->refreshGroupbox(); }
|
||||||
|
void GuiWrapper::refreshPlayerName() const { myW->refreshPlayerName(); }
|
||||||
|
|
||||||
|
void GuiWrapper::dealHoleCards() const { myW->dealHoleCards(); }
|
||||||
void GuiWrapper::dealFlopCards() const { myW->dealFlopCards0(); }
|
void GuiWrapper::dealFlopCards() const { myW->dealFlopCards0(); }
|
||||||
void GuiWrapper::dealTurnCard() const { myW->dealTurnCards0(); }
|
void GuiWrapper::dealTurnCard() const { myW->dealTurnCards0(); }
|
||||||
void GuiWrapper::dealRiverCard() const { myW->dealRiverCards0(); }
|
void GuiWrapper::dealRiverCard() const { myW->dealRiverCards0(); }
|
||||||
|
|
||||||
|
void GuiWrapper::highlightRoundLabel(string round) const { myW->highlightRoundLabel(round); }
|
||||||
|
|
||||||
|
|
||||||
void GuiWrapper::nextPlayerAnimation() const { myW->nextPlayerAnimation(); }
|
void GuiWrapper::nextPlayerAnimation() const { myW->nextPlayerAnimation(); }
|
||||||
|
|
||||||
void GuiWrapper::preflopAnimation1() const { myW->preflopAnimation1(); }
|
void GuiWrapper::preflopAnimation1() const { myW->preflopAnimation1(); }
|
||||||
@@ -71,3 +80,13 @@ void GuiWrapper::riverAnimation1() const { myW->riverAnimation1(); }
|
|||||||
void GuiWrapper::riverAnimation2() const { myW->riverAnimation2(); }
|
void GuiWrapper::riverAnimation2() const { myW->riverAnimation2(); }
|
||||||
|
|
||||||
void GuiWrapper::postRiverAnimation1() const { myW->postRiverAnimation1(); }
|
void GuiWrapper::postRiverAnimation1() const { myW->postRiverAnimation1(); }
|
||||||
|
void GuiWrapper::postRiverRunAnimation1() const { myW->postRiverRunAnimation1(); }
|
||||||
|
|
||||||
|
void GuiWrapper::nextRoundCleanGui() const { myW->nextRoundCleanGui(); }
|
||||||
|
|
||||||
|
void GuiWrapper::meInAction() const { myW->meInAction(); }
|
||||||
|
|
||||||
|
void GuiWrapper::showPlayerActionLogMsg(string playerName, int action, int setValue) const { myLog->showPlayerActionLogMsg(playerName, action, setValue); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+36
-18
@@ -21,6 +21,8 @@
|
|||||||
#define GUIWRAPPER_H
|
#define GUIWRAPPER_H
|
||||||
|
|
||||||
#include <guiinterface.h>
|
#include <guiinterface.h>
|
||||||
|
#include <string>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
class mainWindowImpl;
|
class mainWindowImpl;
|
||||||
class Log;
|
class Log;
|
||||||
@@ -34,32 +36,48 @@ public:
|
|||||||
|
|
||||||
~GuiWrapper();
|
~GuiWrapper();
|
||||||
|
|
||||||
|
void setGame(Game*);
|
||||||
|
void setHand(LocalHand*);
|
||||||
|
void setSession(Session*);
|
||||||
|
|
||||||
|
int getMaxQuantityPlayers() const;
|
||||||
|
|
||||||
|
void refreshSet() const;
|
||||||
|
void refreshChangePlayer() const;
|
||||||
|
void refreshPot() const;
|
||||||
|
void refreshGroupbox() const;
|
||||||
|
void refreshAll() const;
|
||||||
|
void refreshPlayerName() const;
|
||||||
|
|
||||||
|
void dealHoleCards() const;
|
||||||
|
void dealFlopCards() const;
|
||||||
|
void dealTurnCard() const;
|
||||||
|
void dealRiverCard() const;
|
||||||
|
|
||||||
virtual void showPlayerActionLogMsg(std::string playerName, int &action, int &setValue) const;
|
void highlightRoundLabel(std::string round) const;
|
||||||
virtual void refreshSet() const;
|
|
||||||
virtual void refreshChangePlayer() const;
|
|
||||||
|
|
||||||
virtual void dealFlopCards() const;
|
void nextPlayerAnimation() const;
|
||||||
virtual void dealTurnCard() const;
|
|
||||||
virtual void dealRiverCard() const;
|
|
||||||
|
|
||||||
virtual void nextPlayerAnimation() const;
|
void preflopAnimation1() const;
|
||||||
|
void preflopAnimation2() const;
|
||||||
virtual void preflopAnimation1() const;
|
|
||||||
virtual void preflopAnimation2() const;
|
|
||||||
|
|
||||||
virtual void flopAnimation1() const;
|
void flopAnimation1() const;
|
||||||
virtual void flopAnimation2() const;
|
void flopAnimation2() const;
|
||||||
|
|
||||||
virtual void turnAnimation1() const;
|
void turnAnimation1() const;
|
||||||
virtual void turnAnimation2() const;
|
void turnAnimation2() const;
|
||||||
|
|
||||||
virtual void riverAnimation1() const;
|
void riverAnimation1() const;
|
||||||
virtual void riverAnimation2() const;
|
void riverAnimation2() const;
|
||||||
|
|
||||||
virtual void postRiverAnimation1() const;
|
void postRiverAnimation1() const;
|
||||||
// virtual void postRiverAnimation2() const;
|
void postRiverRunAnimation1() const;
|
||||||
|
|
||||||
|
void nextRoundCleanGui() const;
|
||||||
|
|
||||||
|
void meInAction() const;
|
||||||
|
|
||||||
|
void showPlayerActionLogMsg(std::string playerName, int action, int setValue) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
@@ -62,11 +62,3 @@ void Log::showPlayerActionLogMsg(string playerName, int &action, int &setValue)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// void Log::msgPlayerAction(QString playerName, int action , int setValue) {
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// // actualHand->getMainWindowImpl()->textBrowser_Log->append(msg);
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|||||||
@@ -343,7 +343,9 @@ void mainWindowImpl::refreshGroupbox() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void mainWindowImpl::highlightRoundLabel(QString round) {
|
void mainWindowImpl::highlightRoundLabel(string tempround) {
|
||||||
|
|
||||||
|
QString round (QString::fromStdString(tempround));
|
||||||
|
|
||||||
// für PostRiverRun (alte Runden stehen lassen)
|
// für PostRiverRun (alte Runden stehen lassen)
|
||||||
if(round != "") {
|
if(round != "") {
|
||||||
|
|||||||
@@ -22,23 +22,18 @@
|
|||||||
|
|
||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
|
|
||||||
/*#include "newgamedialogimpl.h"
|
|
||||||
#include "aboutpokerthimpl.h"
|
|
||||||
#include "game.h"
|
|
||||||
#include "localhand.h"
|
|
||||||
#include "session.h"*/
|
|
||||||
//#include "player.h"
|
|
||||||
//#include "board.h"
|
|
||||||
|
|
||||||
class Game;
|
class Game;
|
||||||
class LocalHand;
|
|
||||||
class Session;
|
class Session;
|
||||||
|
class LocalHand;
|
||||||
|
|
||||||
class QColor;
|
class QColor;
|
||||||
|
|
||||||
|
|
||||||
class mainWindowImpl: public QMainWindow, public Ui::mainWindow {
|
class mainWindowImpl: public QMainWindow, public Ui::mainWindow {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
@@ -74,7 +69,7 @@ public:
|
|||||||
void meInAction();
|
void meInAction();
|
||||||
void disableMyButtons();
|
void disableMyButtons();
|
||||||
|
|
||||||
void highlightRoundLabel(QString);
|
void highlightRoundLabel(std::string);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ void LocalBoard::collectSets() {
|
|||||||
|
|
||||||
sets = 0;
|
sets = 0;
|
||||||
int i;
|
int i;
|
||||||
for(i=0; i<actualHand->getMainWindowImpl()->getMaxQuantityPlayers(); i++) sets += playerArray[i]->getMySet();
|
for(i=0; i<actualHand->getGuiInterface()->getMaxQuantityPlayers(); i++) sets += playerArray[i]->getMySet();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ void LocalBoard::collectPot() {
|
|||||||
int i;
|
int i;
|
||||||
pot += sets;
|
pot += sets;
|
||||||
sets = 0;
|
sets = 0;
|
||||||
for(i=0; i<actualHand->getMainWindowImpl()->getMaxQuantityPlayers(); i++){ playerArray[i]->setMySetNull(); }
|
for(i=0; i<actualHand->getGuiInterface()->getMaxQuantityPlayers(); i++){ playerArray[i]->setMySetNull(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ LocalFlop::LocalFlop(LocalHand* bR, int id, int qP, int dP, int sB) : myHand(bR)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
//SmallBlind-Position ermitteln
|
//SmallBlind-Position ermitteln
|
||||||
for(i=0; i<myHand->getMainWindowImpl()->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||||
if (myHand->getPlayerArray()[i]->getMyButton() == 2) smallBlindPosition = i;
|
if (myHand->getPlayerArray()[i]->getMyButton() == 2) smallBlindPosition = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,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->getMainWindowImpl()->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); 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; }
|
||||||
}
|
}
|
||||||
@@ -70,14 +70,14 @@ 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->getMainWindowImpl()->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); 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
|
||||||
myHand->getBoard()->collectSets();
|
myHand->getBoard()->collectSets();
|
||||||
myHand->getBoard()->collectPot();
|
myHand->getBoard()->collectPot();
|
||||||
myHand->getMainWindowImpl()->refreshPot();
|
myHand->getGuiInterface()->refreshPot();
|
||||||
myHand->getMainWindowImpl()->refreshAll();
|
myHand->getGuiInterface()->refreshAll();
|
||||||
|
|
||||||
myHand->switchRounds();
|
myHand->switchRounds();
|
||||||
|
|
||||||
@@ -86,16 +86,16 @@ void LocalFlop::flopRun() {
|
|||||||
// Flop ist wirklich dran
|
// Flop ist wirklich dran
|
||||||
|
|
||||||
// n�hsten Spieler ermitteln
|
// n�hsten Spieler ermitteln
|
||||||
do { playersTurn = (playersTurn+1)%(myHand->getMainWindowImpl()->getMaxQuantityPlayers());
|
do { playersTurn = (playersTurn+1)%(myHand->getGuiInterface()->getMaxQuantityPlayers());
|
||||||
} 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->getMainWindowImpl()->getMaxQuantityPlayers() - 1 ) % (myHand->getMainWindowImpl()->getMaxQuantityPlayers());
|
do { activePlayerBeforeSmallBlind = (activePlayerBeforeSmallBlind + myHand->getGuiInterface()->getMaxQuantityPlayers() - 1 ) % (myHand->getGuiInterface()->getMaxQuantityPlayers());
|
||||||
} 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(TRUE);
|
myHand->getPlayerArray()[playersTurn]->setMyTurn(TRUE);
|
||||||
myHand->getMainWindowImpl()->refreshGroupbox();
|
myHand->getGuiInterface()->refreshGroupbox();
|
||||||
|
|
||||||
// cout << "activePlayerBeforeSmallBlind " << activePlayerBeforeSmallBlind << endl;
|
// cout << "activePlayerBeforeSmallBlind " << activePlayerBeforeSmallBlind << endl;
|
||||||
// cout << "playersTurn " << playersTurn << endl;
|
// cout << "playersTurn " << playersTurn << endl;
|
||||||
@@ -106,7 +106,7 @@ void LocalFlop::flopRun() {
|
|||||||
// Wir sind dran
|
// Wir sind dran
|
||||||
// cout << "actualRound " << myHand->getActualRound() << endl;
|
// cout << "actualRound " << myHand->getActualRound() << endl;
|
||||||
// cout << "highestSet vor meInAction " << highestSet << endl;
|
// cout << "highestSet vor meInAction " << highestSet << endl;
|
||||||
myHand->getMainWindowImpl()->meInAction();
|
myHand->getGuiInterface()->meInAction();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//Gegner sind dran
|
//Gegner sind dran
|
||||||
|
|||||||
@@ -21,12 +21,12 @@
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
LocalHand::LocalHand(mainWindowImpl *w, GuiInterface *g, LocalBoard *b, LocalPlayer **p, int id, int qP, int dP, int sB,int sC) : myW(w), myGui(g), myBoard(b), playerArray(p), myPreflop(0), myFlop(0), myTurn(0), myRiver(0), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), actualRound(0), smallBlind(sB), startCash(sC), allInCondition(FALSE)
|
LocalHand::LocalHand(GuiInterface *g, LocalBoard *b, LocalPlayer **p, int id, int qP, int dP, int sB,int sC) : myW(w), myGui(g), myBoard(b), playerArray(p), myPreflop(0), myFlop(0), myTurn(0), myRiver(0), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), actualRound(0), smallBlind(sB), startCash(sC), allInCondition(FALSE)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
CardsValue myCardsValue;
|
CardsValue myCardsValue;
|
||||||
|
|
||||||
myW->setHand(this);
|
myGui->setHand(this);
|
||||||
myBoard->setHand(this);
|
myBoard->setHand(this);
|
||||||
|
|
||||||
// myEngine->setHand(this);
|
// myEngine->setHand(this);
|
||||||
@@ -43,7 +43,7 @@ LocalHand::LocalHand(mainWindowImpl *w, GuiInterface *g, LocalBoard *b, LocalPla
|
|||||||
// Dealer, SB, BB bestimmen
|
// Dealer, SB, BB bestimmen
|
||||||
assignButtons();
|
assignButtons();
|
||||||
|
|
||||||
myW->refreshAll();
|
myGui->refreshAll();
|
||||||
|
|
||||||
// Karten generieren und Board sowie Player zuweisen
|
// Karten generieren und Board sowie Player zuweisen
|
||||||
Tools myTool;
|
Tools myTool;
|
||||||
@@ -67,7 +67,7 @@ LocalHand::LocalHand(mainWindowImpl *w, GuiInterface *g, LocalBoard *b, LocalPla
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Karten austeilen
|
// Karten austeilen
|
||||||
myW->dealHoleCards();
|
myGui->dealHoleCards();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ void LocalHand::assignButtons() {
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
// alle Buttons loeschen
|
// alle Buttons loeschen
|
||||||
for (i=0; i<myW->getMaxQuantityPlayers(); i++) { playerArray[i]->setMyButton(0); }
|
for (i=0; i<myGui->getMaxQuantityPlayers(); i++) { playerArray[i]->setMyButton(0); }
|
||||||
|
|
||||||
// DealerButton zuweisen
|
// DealerButton zuweisen
|
||||||
playerArray[dealerPosition]->setMyButton(1);
|
playerArray[dealerPosition]->setMyButton(1);
|
||||||
@@ -111,7 +111,7 @@ void LocalHand::assignButtons() {
|
|||||||
// Small Blind zuweisen und setzen
|
// Small Blind zuweisen und setzen
|
||||||
i = dealerPosition;
|
i = dealerPosition;
|
||||||
do {
|
do {
|
||||||
i = (i+1)%(myW->getMaxQuantityPlayers());
|
i = (i+1)%(myGui->getMaxQuantityPlayers());
|
||||||
if(playerArray[i]->getMyActiveStatus()) {
|
if(playerArray[i]->getMyActiveStatus()) {
|
||||||
playerArray[i]->setMyButton(2);
|
playerArray[i]->setMyButton(2);
|
||||||
// mit SmallBlind All In ?
|
// mit SmallBlind All In ?
|
||||||
@@ -131,7 +131,7 @@ void LocalHand::assignButtons() {
|
|||||||
|
|
||||||
// Big Blind zuweisen
|
// Big Blind zuweisen
|
||||||
do {
|
do {
|
||||||
i = (i+1)%(myW->getMaxQuantityPlayers());
|
i = (i+1)%(myGui->getMaxQuantityPlayers());
|
||||||
if(playerArray[i]->getMyActiveStatus()) {
|
if(playerArray[i]->getMyActiveStatus()) {
|
||||||
playerArray[i]->setMyButton(3);
|
playerArray[i]->setMyButton(3);
|
||||||
// mit BigBlind All In ?
|
// mit BigBlind All In ?
|
||||||
@@ -159,19 +159,19 @@ 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
|
||||||
int activePlayersCounter = 0;
|
int activePlayersCounter = 0;
|
||||||
for (i=0; i<myW->getMaxQuantityPlayers(); i++) {
|
for (i=0; i<myGui->getMaxQuantityPlayers(); 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<myW->getMaxQuantityPlayers(); i++) {
|
for (i=0; i<myGui->getMaxQuantityPlayers(); i++) {
|
||||||
if (playerArray[i]->getMyAction() == 6) allInPlayersCounter++;
|
if (playerArray[i]->getMyAction() == 6) allInPlayersCounter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(activePlayersCounter==1) {
|
if(activePlayersCounter==1) {
|
||||||
myBoard->collectPot();
|
myBoard->collectPot();
|
||||||
myW->refreshPot();
|
myGui->refreshPot();
|
||||||
myGui->refreshSet();
|
myGui->refreshSet();
|
||||||
actualRound = 4;
|
actualRound = 4;
|
||||||
}
|
}
|
||||||
@@ -188,7 +188,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<myW->getMaxQuantityPlayers(); i++) {
|
for (i=0; i<myGui->getMaxQuantityPlayers(); 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) {
|
||||||
@@ -213,13 +213,13 @@ void LocalHand::switchRounds() {
|
|||||||
// beim Vorliegen einer All In Kondition -> Ausfhrung einer Sonderprozedur
|
// beim Vorliegen einer All In Kondition -> Ausfhrung einer Sonderprozedur
|
||||||
if(allInCondition) {
|
if(allInCondition) {
|
||||||
myBoard->collectPot();
|
myBoard->collectPot();
|
||||||
myW->refreshPot();
|
myGui->refreshPot();
|
||||||
myW->refreshSet();
|
myGui->refreshSet();
|
||||||
actualRound++;
|
actualRound++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
myW->refreshGroupbox();
|
myGui->refreshGroupbox();
|
||||||
highlightRoundLabel();
|
highlightRoundLabel();
|
||||||
// /*/*/*/*cout <<*/*/*/*/ "NextPlayerSpeed1 stop" << endl;
|
// /*/*/*/*cout <<*/*/*/*/ "NextPlayerSpeed1 stop" << endl;
|
||||||
//
|
//
|
||||||
@@ -259,22 +259,22 @@ void LocalHand::switchRounds() {
|
|||||||
void LocalHand::highlightRoundLabel() {
|
void LocalHand::highlightRoundLabel() {
|
||||||
switch(actualRound) {
|
switch(actualRound) {
|
||||||
case 0: {
|
case 0: {
|
||||||
myW->highlightRoundLabel("Preflop");
|
myGui->highlightRoundLabel("Preflop");
|
||||||
} break;
|
} break;
|
||||||
case 1: {
|
case 1: {
|
||||||
myW->highlightRoundLabel("Flop");
|
myGui->highlightRoundLabel("Flop");
|
||||||
} break;
|
} break;
|
||||||
case 2: {
|
case 2: {
|
||||||
myW->highlightRoundLabel("Turn");
|
myGui->highlightRoundLabel("Turn");
|
||||||
} break;
|
} break;
|
||||||
case 3: {
|
case 3: {
|
||||||
myW->highlightRoundLabel("River");
|
myGui->highlightRoundLabel("River");
|
||||||
} break;
|
} break;
|
||||||
case 4: {
|
case 4: {
|
||||||
myW->highlightRoundLabel("");
|
myGui->highlightRoundLabel("");
|
||||||
} break;
|
} break;
|
||||||
default: {
|
default: {
|
||||||
myW->highlightRoundLabel("!!! FEHLER !!!");
|
myGui->highlightRoundLabel("!!! FEHLER !!!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#ifndef LOCALHAND_H
|
#ifndef LOCALHAND_H
|
||||||
#define LOCALHAND_H
|
#define LOCALHAND_H
|
||||||
|
|
||||||
#include "mainwindowimpl.h"
|
|
||||||
#include "guiinterface.h"
|
#include "guiinterface.h"
|
||||||
#include "localboard.h"
|
#include "localboard.h"
|
||||||
#include "localplayer.h"
|
#include "localplayer.h"
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
#include "localturn.h"
|
#include "localturn.h"
|
||||||
#include "localriver.h"
|
#include "localriver.h"
|
||||||
|
|
||||||
class mainWindowImpl;
|
|
||||||
class GuiInterface;
|
class GuiInterface;
|
||||||
class LocalBoard;
|
class LocalBoard;
|
||||||
class LocalPlayer;
|
class LocalPlayer;
|
||||||
@@ -43,7 +43,7 @@ class LocalRiver;
|
|||||||
class LocalHand {
|
class LocalHand {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LocalHand(mainWindowImpl*, GuiInterface*, LocalBoard*, LocalPlayer**, int, int, int, int, int);
|
LocalHand(GuiInterface*, LocalBoard*, LocalPlayer**, int, int, int, int, int);
|
||||||
|
|
||||||
~LocalHand();
|
~LocalHand();
|
||||||
|
|
||||||
@@ -53,7 +53,6 @@ public:
|
|||||||
LocalFlop* getFlop() const { return myFlop; }
|
LocalFlop* getFlop() const { return myFlop; }
|
||||||
LocalTurn* getTurn() const { return myTurn; }
|
LocalTurn* getTurn() const { return myTurn; }
|
||||||
LocalRiver* getRiver() const { return myRiver; }
|
LocalRiver* getRiver() const { return myRiver; }
|
||||||
mainWindowImpl* getMainWindowImpl() const { return myW; }
|
|
||||||
GuiInterface* getGuiInterface() const { return myGui; }
|
GuiInterface* getGuiInterface() const { return myGui; }
|
||||||
|
|
||||||
void setMyID(const int& theValue) { myID = theValue; }
|
void setMyID(const int& theValue) { myID = theValue; }
|
||||||
@@ -82,7 +81,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mainWindowImpl *myW;
|
|
||||||
GuiInterface *myGui;
|
GuiInterface *myGui;
|
||||||
LocalBoard *myBoard;
|
LocalBoard *myBoard;
|
||||||
LocalPlayer **playerArray;
|
LocalPlayer **playerArray;
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ void LocalPlayer::action() {
|
|||||||
preflopEngine();
|
preflopEngine();
|
||||||
|
|
||||||
actualBoard->collectSets();
|
actualBoard->collectSets();
|
||||||
actualHand->getMainWindowImpl()->refreshPot();
|
actualHand->getGuiInterface()->refreshPot();
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case 1: {
|
case 1: {
|
||||||
@@ -62,7 +62,7 @@ void LocalPlayer::action() {
|
|||||||
flopEngine();
|
flopEngine();
|
||||||
|
|
||||||
actualBoard->collectSets();
|
actualBoard->collectSets();
|
||||||
actualHand->getMainWindowImpl()->refreshPot();
|
actualHand->getGuiInterface()->refreshPot();
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case 2: {
|
case 2: {
|
||||||
@@ -70,7 +70,7 @@ void LocalPlayer::action() {
|
|||||||
turnEngine();
|
turnEngine();
|
||||||
|
|
||||||
actualBoard->collectSets();
|
actualBoard->collectSets();
|
||||||
actualHand->getMainWindowImpl()->refreshPot();
|
actualHand->getGuiInterface()->refreshPot();
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case 3: {
|
case 3: {
|
||||||
@@ -78,7 +78,7 @@ void LocalPlayer::action() {
|
|||||||
riverEngine();
|
riverEngine();
|
||||||
|
|
||||||
actualBoard->collectSets();
|
actualBoard->collectSets();
|
||||||
actualHand->getMainWindowImpl()->refreshPot();
|
actualHand->getGuiInterface()->refreshPot();
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
default: {}
|
default: {}
|
||||||
|
|||||||
@@ -27,12 +27,12 @@ LocalPreflop::LocalPreflop(LocalHand* bR, int id, int qP, int dP, int sB) : myHa
|
|||||||
{
|
{
|
||||||
|
|
||||||
myHand->getBoard()->collectSets();
|
myHand->getBoard()->collectSets();
|
||||||
myHand->getMainWindowImpl()->refreshPot();
|
myHand->getGuiInterface()->refreshPot();
|
||||||
|
|
||||||
// // BigBlind ermitteln
|
// // BigBlind ermitteln
|
||||||
bigBlindPosition = dealerPosition;
|
bigBlindPosition = dealerPosition;
|
||||||
while (myHand->getPlayerArray()[bigBlindPosition]->getMyButton() != 3) {
|
while (myHand->getPlayerArray()[bigBlindPosition]->getMyButton() != 3) {
|
||||||
bigBlindPosition = (bigBlindPosition+1)%(myHand->getMainWindowImpl()->getMaxQuantityPlayers());
|
bigBlindPosition = (bigBlindPosition+1)%(myHand->getGuiInterface()->getMaxQuantityPlayers());
|
||||||
}
|
}
|
||||||
|
|
||||||
// // erste Spielernummer fr preflopRun() setzen
|
// // erste Spielernummer fr preflopRun() setzen
|
||||||
@@ -55,7 +55,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->getMainWindowImpl()->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); 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; }
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,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->getMainWindowImpl()->getMaxQuantityPlayers());
|
bigBlindPosition = (bigBlindPosition+1)%(myHand->getGuiInterface()->getMaxQuantityPlayers());
|
||||||
}
|
}
|
||||||
|
|
||||||
// prfen, ob Preflop wirklich dran ist
|
// prfen, ob Preflop wirklich dran ist
|
||||||
@@ -75,14 +75,14 @@ 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->getMainWindowImpl()->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); 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
|
||||||
myHand->getBoard()->collectSets();
|
myHand->getBoard()->collectSets();
|
||||||
myHand->getBoard()->collectPot();
|
myHand->getBoard()->collectPot();
|
||||||
myHand->getMainWindowImpl()->refreshPot();
|
myHand->getGuiInterface()->refreshPot();
|
||||||
myHand->getMainWindowImpl()->refreshAll();
|
myHand->getGuiInterface()->refreshAll();
|
||||||
|
|
||||||
myHand->switchRounds();
|
myHand->switchRounds();
|
||||||
|
|
||||||
@@ -93,18 +93,18 @@ void LocalPreflop::preflopRun() {
|
|||||||
// n�hsten Spieler ermitteln
|
// n�hsten Spieler ermitteln
|
||||||
do {
|
do {
|
||||||
|
|
||||||
playersTurn = (playersTurn+1)%(myHand->getMainWindowImpl()->getMaxQuantityPlayers());
|
playersTurn = (playersTurn+1)%(myHand->getGuiInterface()->getMaxQuantityPlayers());
|
||||||
// falls BigBlind, dann PreflopFirstRound zuende
|
// falls BigBlind, dann PreflopFirstRound zuende
|
||||||
if(myHand->getPlayerArray()[playersTurn]->getMyButton() == 3) preflopFirstRound = FALSE;
|
if(myHand->getPlayerArray()[playersTurn]->getMyButton() == 3) preflopFirstRound = FALSE;
|
||||||
|
|
||||||
} 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);
|
||||||
|
|
||||||
myHand->getPlayerArray()[playersTurn]->setMyTurn(TRUE);
|
myHand->getPlayerArray()[playersTurn]->setMyTurn(TRUE);
|
||||||
myHand->getMainWindowImpl()->refreshGroupbox();
|
myHand->getGuiInterface()->refreshGroupbox();
|
||||||
|
|
||||||
if(playersTurn == 0) {
|
if(playersTurn == 0) {
|
||||||
// Wir sind dran
|
// Wir sind dran
|
||||||
myHand->getMainWindowImpl()->meInAction();
|
myHand->getGuiInterface()->meInAction();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//Gegner sind dran
|
//Gegner sind dran
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ LocalRiver::LocalRiver(LocalHand* bR, int id, int qP, int dP, int sB) : myHand(b
|
|||||||
{ int i;
|
{ int i;
|
||||||
|
|
||||||
//SmallBlind-Position ermitteln
|
//SmallBlind-Position ermitteln
|
||||||
for(i=0; i<myHand->getMainWindowImpl()->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||||
if (myHand->getPlayerArray()[i]->getMyButton() == 2) smallBlindPosition = i;
|
if (myHand->getPlayerArray()[i]->getMyButton() == 2) smallBlindPosition = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,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->getMainWindowImpl()->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); 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,14 +71,14 @@ 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->getMainWindowImpl()->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); 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
|
||||||
myHand->getBoard()->collectSets();
|
myHand->getBoard()->collectSets();
|
||||||
myHand->getBoard()->collectPot();
|
myHand->getBoard()->collectPot();
|
||||||
myHand->getMainWindowImpl()->refreshPot();
|
myHand->getGuiInterface()->refreshPot();
|
||||||
myHand->getMainWindowImpl()->refreshAll();
|
myHand->getGuiInterface()->refreshAll();
|
||||||
|
|
||||||
myHand->switchRounds();
|
myHand->switchRounds();
|
||||||
|
|
||||||
@@ -87,16 +87,16 @@ void LocalRiver::riverRun() {
|
|||||||
// River ist wirklich dran
|
// River ist wirklich dran
|
||||||
|
|
||||||
// nᅵhsten Spieler ermitteln
|
// nᅵhsten Spieler ermitteln
|
||||||
do { playersTurn = (playersTurn+1)%(myHand->getMainWindowImpl()->getMaxQuantityPlayers());
|
do { playersTurn = (playersTurn+1)%(myHand->getGuiInterface()->getMaxQuantityPlayers());
|
||||||
} 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->getMainWindowImpl()->getMaxQuantityPlayers() - 1 ) % (myHand->getMainWindowImpl()->getMaxQuantityPlayers());
|
do { activePlayerBeforeSmallBlind = (activePlayerBeforeSmallBlind + myHand->getGuiInterface()->getMaxQuantityPlayers() - 1 ) % (myHand->getGuiInterface()->getMaxQuantityPlayers());
|
||||||
} 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(TRUE);
|
myHand->getPlayerArray()[playersTurn]->setMyTurn(TRUE);
|
||||||
myHand->getMainWindowImpl()->refreshGroupbox();
|
myHand->getGuiInterface()->refreshGroupbox();
|
||||||
|
|
||||||
// cout << "activePlayerBeforeSmallBlind " << activePlayerBeforeSmallBlind << endl;
|
// cout << "activePlayerBeforeSmallBlind " << activePlayerBeforeSmallBlind << endl;
|
||||||
// cout << "playersTurn " << playersTurn << endl;
|
// cout << "playersTurn " << playersTurn << endl;
|
||||||
@@ -107,7 +107,7 @@ void LocalRiver::riverRun() {
|
|||||||
// Wir sind dran
|
// Wir sind dran
|
||||||
// cout << "actualRound " << myHand->getActualRound() << endl;
|
// cout << "actualRound " << myHand->getActualRound() << endl;
|
||||||
// cout << "highestSet vor meInAction " << highestSet << endl;
|
// cout << "highestSet vor meInAction " << highestSet << endl;
|
||||||
myHand->getMainWindowImpl()->meInAction();
|
myHand->getGuiInterface()->meInAction();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//Gegner sind dran
|
//Gegner sind dran
|
||||||
@@ -131,7 +131,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->getMainWindowImpl()->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||||
|
|
||||||
// cout << "Spieler: " << i << " hat: " << myHand->getPlayerArray()[i]->getMyCardsValueInt() << endl;
|
// cout << "Spieler: " << i << " hat: " << myHand->getPlayerArray()[i]->getMyCardsValueInt() << endl;
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ void LocalRiver::postRiverRun() {
|
|||||||
myHand->getBoard()->setPot(0);
|
myHand->getBoard()->setPot(0);
|
||||||
|
|
||||||
//starte die Animaionsreihe
|
//starte die Animaionsreihe
|
||||||
myHand->getMainWindowImpl()->postRiverRunAnimation1();
|
myHand->getGuiInterface()->postRiverRunAnimation1();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocalRiver::nextPlayer2() {
|
void LocalRiver::nextPlayer2() {
|
||||||
@@ -177,14 +177,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->getMainWindowImpl()->getMaxQuantityPlayers()];
|
int *winnersArray = new int[myHand->getGuiInterface()->getMaxQuantityPlayers()];
|
||||||
|
|
||||||
// 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[myHand->getMainWindowImpl()->getMaxQuantityPlayers()];
|
int roundSetArray[myHand->getGuiInterface()->getMaxQuantityPlayers()];
|
||||||
for(i=0; i<myHand->getMainWindowImpl()->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); 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)
|
||||||
@@ -194,10 +194,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[myHand->getMainWindowImpl()->getMaxQuantityPlayers()];
|
int cardsValueArray[myHand->getGuiInterface()->getMaxQuantityPlayers()];
|
||||||
int playerWantsPotCounter = 0;
|
int playerWantsPotCounter = 0;
|
||||||
|
|
||||||
for(i=0; i<myHand->getMainWindowImpl()->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); 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) {
|
||||||
@@ -230,7 +230,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->getMainWindowImpl()->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||||
if(cardsValueArray[i] > highestCardsValueTemp ) {
|
if(cardsValueArray[i] > highestCardsValueTemp ) {
|
||||||
highestCardsValueTemp = myHand->getPlayerArray()[i]->getMyCardsValueInt();
|
highestCardsValueTemp = myHand->getPlayerArray()[i]->getMyCardsValueInt();
|
||||||
}
|
}
|
||||||
@@ -239,7 +239,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->getMainWindowImpl()->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||||
if(cardsValueArray[i] == highestCardsValueTemp ) {
|
if(cardsValueArray[i] == highestCardsValueTemp ) {
|
||||||
winnersArray[winnersCounter] = i;
|
winnersArray[winnersCounter] = i;
|
||||||
winnersCounter++;
|
winnersCounter++;
|
||||||
@@ -266,7 +266,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->getMainWindowImpl()->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); 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) {
|
||||||
@@ -346,7 +346,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->getMainWindowImpl()->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||||
|
|
||||||
// prfen ob Spieler i zu den Winnern gehᅵt
|
// prfen ob Spieler i zu den Winnern gehᅵt
|
||||||
playerIsWinner = FALSE;
|
playerIsWinner = FALSE;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ LocalTurn::LocalTurn(LocalHand* bR, int id, int qP, int dP, int sB) : myHand(bR)
|
|||||||
{ int i;
|
{ int i;
|
||||||
|
|
||||||
//SmallBlind-Position ermitteln
|
//SmallBlind-Position ermitteln
|
||||||
for(i=0; i<myHand->getMainWindowImpl()->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); i++) {
|
||||||
if (myHand->getPlayerArray()[i]->getMyButton() == 2) smallBlindPosition = i;
|
if (myHand->getPlayerArray()[i]->getMyButton() == 2) smallBlindPosition = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,7 +53,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->getMainWindowImpl()->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); 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,14 +71,14 @@ 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->getMainWindowImpl()->getMaxQuantityPlayers(); i++) {
|
for(i=0; i<myHand->getGuiInterface()->getMaxQuantityPlayers(); 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
|
||||||
myHand->getBoard()->collectSets();
|
myHand->getBoard()->collectSets();
|
||||||
myHand->getBoard()->collectPot();
|
myHand->getBoard()->collectPot();
|
||||||
myHand->getMainWindowImpl()->refreshPot();
|
myHand->getGuiInterface()->refreshPot();
|
||||||
myHand->getMainWindowImpl()->refreshAll();
|
myHand->getGuiInterface()->refreshAll();
|
||||||
|
|
||||||
myHand->switchRounds();
|
myHand->switchRounds();
|
||||||
|
|
||||||
@@ -87,16 +87,16 @@ void LocalTurn::turnRun() {
|
|||||||
// Turn ist wirklich dran
|
// Turn ist wirklich dran
|
||||||
|
|
||||||
// n�hsten Spieler ermitteln
|
// n�hsten Spieler ermitteln
|
||||||
do { playersTurn = (playersTurn+1)%(myHand->getMainWindowImpl()->getMaxQuantityPlayers());
|
do { playersTurn = (playersTurn+1)%(myHand->getGuiInterface()->getMaxQuantityPlayers());
|
||||||
} 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->getMainWindowImpl()->getMaxQuantityPlayers() - 1 ) % (myHand->getMainWindowImpl()->getMaxQuantityPlayers());
|
do { activePlayerBeforeSmallBlind = (activePlayerBeforeSmallBlind + myHand->getGuiInterface()->getMaxQuantityPlayers() - 1 ) % (myHand->getGuiInterface()->getMaxQuantityPlayers());
|
||||||
} 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(TRUE);
|
myHand->getPlayerArray()[playersTurn]->setMyTurn(TRUE);
|
||||||
myHand->getMainWindowImpl()->refreshGroupbox();
|
myHand->getGuiInterface()->refreshGroupbox();
|
||||||
|
|
||||||
// cout << "activePlayerBeforeSmallBlind " << activePlayerBeforeSmallBlind << endl;
|
// cout << "activePlayerBeforeSmallBlind " << activePlayerBeforeSmallBlind << endl;
|
||||||
// cout << "playersTurn " << playersTurn << endl;
|
// cout << "playersTurn " << playersTurn << endl;
|
||||||
@@ -107,7 +107,7 @@ void LocalTurn::turnRun() {
|
|||||||
// Wir sind dran
|
// Wir sind dran
|
||||||
// cout << "actualRound " << myHand->getActualRound() << endl;
|
// cout << "actualRound " << myHand->getActualRound() << endl;
|
||||||
// cout << "highestSet vor meInAction " << highestSet << endl;
|
// cout << "highestSet vor meInAction " << highestSet << endl;
|
||||||
myHand->getMainWindowImpl()->meInAction();
|
myHand->getGuiInterface()->meInAction();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//Gegner sind dran
|
//Gegner sind dran
|
||||||
|
|||||||
+1
-1
@@ -45,7 +45,7 @@ int main( int argc, char **argv )
|
|||||||
GuiInterface *myGuiInterface = new GuiWrapper(myW);
|
GuiInterface *myGuiInterface = new GuiWrapper(myW);
|
||||||
|
|
||||||
|
|
||||||
Session theFirst(myW, myGuiInterface);
|
Session theFirst(myGuiInterface);
|
||||||
|
|
||||||
|
|
||||||
return a.exec();
|
return a.exec();
|
||||||
|
|||||||
+3
-4
@@ -18,13 +18,12 @@
|
|||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#include "session.h"
|
#include "session.h"
|
||||||
#include "mainwindowimpl.h"
|
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
#include "guiinterface.h"
|
#include "guiinterface.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
Session::Session(mainWindowImpl* w, GuiInterface* g) : actualGame(0), myW(w), myGui(g)
|
Session::Session(GuiInterface* g) : actualGame(0), myGui(g)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@@ -33,7 +32,7 @@ Session::Session(mainWindowImpl* w, GuiInterface* g) : actualGame(0), myW(w), my
|
|||||||
// a.setMainWidget( w );
|
// a.setMainWidget( w );
|
||||||
// myW->show();
|
// myW->show();
|
||||||
// Session an mainwindowimpl bergeben
|
// Session an mainwindowimpl bergeben
|
||||||
myW->setSession(this);
|
myGui->setSession(this);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -46,7 +45,7 @@ Session::~Session()
|
|||||||
|
|
||||||
void Session::startGame(int qP, int sC, int sB) {
|
void Session::startGame(int qP, int sC, int sB) {
|
||||||
|
|
||||||
actualGame = new Game(myW, myGui, qP, sC, sB);
|
actualGame = new Game(myGui, qP, sC, sB);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-3
@@ -23,7 +23,6 @@
|
|||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
class mainWindowImpl;
|
|
||||||
class GuiInterface;
|
class GuiInterface;
|
||||||
class Game;
|
class Game;
|
||||||
|
|
||||||
@@ -31,7 +30,7 @@ class Game;
|
|||||||
class Session{
|
class Session{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Session(mainWindowImpl*, GuiInterface*);
|
Session(GuiInterface*);
|
||||||
|
|
||||||
~Session();
|
~Session();
|
||||||
|
|
||||||
@@ -40,7 +39,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Game *actualGame;
|
Game *actualGame;
|
||||||
mainWindowImpl *myW;
|
|
||||||
GuiInterface *myGui;
|
GuiInterface *myGui;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user