more polymorphie steps for BeRo (sry lotodore for last buggy rev)
This commit is contained in:
+2
-2
@@ -340,8 +340,8 @@ mac{
|
|||||||
INCLUDEPATH += /Library/Frameworks/SDL_mixer.framework/Headers
|
INCLUDEPATH += /Library/Frameworks/SDL_mixer.framework/Headers
|
||||||
}
|
}
|
||||||
|
|
||||||
CONFIG += qt release
|
#CONFIG += qt release
|
||||||
#CONFIG += qt warn_on debug
|
CONFIG += qt warn_on debug
|
||||||
UI_DIR = uics
|
UI_DIR = uics
|
||||||
TARGET = bin/pokerth
|
TARGET = bin/pokerth
|
||||||
MOC_DIR = mocs
|
MOC_DIR = mocs
|
||||||
|
|||||||
@@ -23,7 +23,9 @@ public:
|
|||||||
|
|
||||||
virtual ~BeRoFactoryInterface();
|
virtual ~BeRoFactoryInterface();
|
||||||
|
|
||||||
virtual BeRoInterface* switchRounds(int) = 0;
|
virtual BeRoInterface* switchRounds(BeRoInterface*, int) = 0;
|
||||||
|
|
||||||
|
virtual BeRoInterface* createBeRoPreflop() =0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ public:
|
|||||||
virtual void setHighestSet(int) =0;
|
virtual void setHighestSet(int) =0;
|
||||||
virtual int getHighestSet() const =0;
|
virtual int getHighestSet() const =0;
|
||||||
|
|
||||||
|
virtual void setHighestCardsValue(int theValue) =0;
|
||||||
|
virtual void resetFirstRun() =0;
|
||||||
|
virtual int getHighestCardsValue() =0;
|
||||||
|
|
||||||
virtual void preflopRun() =0;
|
virtual void preflopRun() =0;
|
||||||
virtual void flopRun() =0;
|
virtual void flopRun() =0;
|
||||||
virtual void turnRun() =0;
|
virtual void turnRun() =0;
|
||||||
|
|||||||
@@ -39,9 +39,9 @@ public:
|
|||||||
virtual PlayerInterface** getPlayerArray() const =0;
|
virtual PlayerInterface** getPlayerArray() const =0;
|
||||||
virtual BoardInterface* getBoard() const =0;
|
virtual BoardInterface* getBoard() const =0;
|
||||||
virtual BeRoInterface* getPreflop() const =0;
|
virtual BeRoInterface* getPreflop() const =0;
|
||||||
virtual FlopInterface* getFlop() const =0;
|
virtual BeRoInterface* getFlop() const =0;
|
||||||
virtual TurnInterface* getTurn() const =0;
|
virtual BeRoInterface* getTurn() const =0;
|
||||||
virtual RiverInterface* getRiver() const =0;
|
virtual BeRoInterface* getRiver() const =0;
|
||||||
virtual GuiInterface* getGuiInterface() const =0;
|
virtual GuiInterface* getGuiInterface() const =0;
|
||||||
virtual BeRoInterface* getCurrentBeRo() const =0;
|
virtual BeRoInterface* getCurrentBeRo() const =0;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,19 @@ public:
|
|||||||
~LocalBeRo();
|
~LocalBeRo();
|
||||||
|
|
||||||
int getMyBeRoID() const { return myBeRoID; }
|
int getMyBeRoID() const { return myBeRoID; }
|
||||||
|
|
||||||
|
int getHighestCardsValue() {}
|
||||||
|
void setHighestCardsValue(int theValue) {}
|
||||||
|
|
||||||
|
//only until bero refactory is over
|
||||||
|
void preflopRun() {}
|
||||||
|
void flopRun() {}
|
||||||
|
void riverRun() {}
|
||||||
|
void turnRun() {}
|
||||||
|
void postRiverRun() {}
|
||||||
|
|
||||||
|
void resetFirstRun() {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
int myBeRoID;
|
int myBeRoID;
|
||||||
|
|||||||
@@ -21,70 +21,56 @@ LocalBeRoFactory::LocalBeRoFactory (HandInterface* hi, int id, int aP, int dP, i
|
|||||||
LocalBeRoFactory::~LocalBeRoFactory()
|
LocalBeRoFactory::~LocalBeRoFactory()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
BeRoInterface* LocalBeRoFactory::switchRounds(int currentRound)
|
BeRoInterface* LocalBeRoFactory::createBeRoPreflop() {
|
||||||
|
|
||||||
|
BeRoInterface* preflopBeRo = new LocalBeRoPreflop ( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
|
||||||
|
|
||||||
|
return preflopBeRo;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
BeRoInterface* LocalBeRoFactory::switchRounds(BeRoInterface* currentBeRo, int currentRound)
|
||||||
{
|
{
|
||||||
|
if(currentRound != currentBeRo->getMyBeRoID()) {
|
||||||
|
|
||||||
BeRoInterface* myBeRo = NULL;
|
delete currentBeRo;
|
||||||
|
currentBeRo = NULL;
|
||||||
|
|
||||||
switch(currentRound) {
|
switch(currentRound) {
|
||||||
case GAME_STATE_PREFLOP: {
|
case GAME_STATE_PREFLOP: {
|
||||||
if(currentRound != myHand->getCurrentBeRo()->getMyBeRoID()) {
|
|
||||||
|
|
||||||
delete myBeRo;
|
currentBeRo = new LocalBeRoPreflop ( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
|
||||||
myBeRo = NULL;
|
|
||||||
|
|
||||||
myBeRo = new LocalBeRoPreflop ( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
|
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
break;
|
case GAME_STATE_FLOP: {
|
||||||
case GAME_STATE_FLOP: {
|
|
||||||
if(currentRound != myHand->getCurrentBeRo()->getMyBeRoID()) {
|
currentBeRo = new LocalBeRoFlop( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
|
||||||
|
|
||||||
delete myBeRo;
|
|
||||||
myBeRo = NULL;
|
|
||||||
|
|
||||||
myBeRo = new LocalBeRoFlop( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
|
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
break;
|
case GAME_STATE_TURN: {
|
||||||
case GAME_STATE_TURN: {
|
|
||||||
if(currentRound != myHand->getCurrentBeRo()->getMyBeRoID()) {
|
currentBeRo = new LocalBeRoTurn( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
|
||||||
|
|
||||||
delete myBeRo;
|
|
||||||
myBeRo = NULL;
|
|
||||||
|
|
||||||
myBeRo = new LocalBeRoTurn( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
|
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
break;
|
case GAME_STATE_RIVER: {
|
||||||
case GAME_STATE_RIVER: {
|
|
||||||
if(currentRound != myHand->getCurrentBeRo()->getMyBeRoID()) {
|
currentBeRo = new LocalBeRoRiver ( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
|
||||||
|
|
||||||
delete myBeRo;
|
|
||||||
myBeRo = NULL;
|
|
||||||
|
|
||||||
myBeRo = new LocalBeRoRiver ( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
|
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
break;
|
case GAME_STATE_POST_RIVER: {
|
||||||
case GAME_STATE_POST_RIVER: {
|
|
||||||
if(currentRound != myHand->getCurrentBeRo()->getMyBeRoID()) {
|
currentBeRo = new LocalBeRoPostRiver ( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
|
||||||
|
|
||||||
delete myBeRo;
|
|
||||||
myBeRo = NULL;
|
|
||||||
|
|
||||||
myBeRo = new LocalBeRoPostRiver ( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
default: { cout << "BeRoFactory-ERROR" << endl; }
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
default: { cout << "BeRoFactory-ERROR" << endl; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return currentBeRo;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return myBeRo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,9 @@ public:
|
|||||||
|
|
||||||
~LocalBeRoFactory();
|
~LocalBeRoFactory();
|
||||||
|
|
||||||
BeRoInterface* switchRounds(int);
|
BeRoInterface* switchRounds(BeRoInterface*, int);
|
||||||
|
|
||||||
|
BeRoInterface* createBeRoPreflop();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
@@ -52,12 +52,6 @@ public:
|
|||||||
void flopRun();
|
void flopRun();
|
||||||
void nextPlayer2();
|
void nextPlayer2();
|
||||||
|
|
||||||
//only until bero refactory is over
|
|
||||||
void preflopRun() {}
|
|
||||||
void turnRun() {}
|
|
||||||
void riverRun() {}
|
|
||||||
void postRiverRun() {}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
HandInterface *myHand;
|
HandInterface *myHand;
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ public:
|
|||||||
LocalBeRoPreflop(HandInterface*, int, int, int, int);
|
LocalBeRoPreflop(HandInterface*, int, int, int, int);
|
||||||
~LocalBeRoPreflop();
|
~LocalBeRoPreflop();
|
||||||
|
|
||||||
|
|
||||||
void setPlayersTurn(int theValue) { playersTurn = theValue; }
|
void setPlayersTurn(int theValue) { playersTurn = theValue; }
|
||||||
int getPlayersTurn() const { return playersTurn; }
|
int getPlayersTurn() const { return playersTurn; }
|
||||||
|
|
||||||
@@ -41,12 +40,6 @@ public:
|
|||||||
void preflopRun();
|
void preflopRun();
|
||||||
void nextPlayer2();
|
void nextPlayer2();
|
||||||
|
|
||||||
//only until bero refactory is over
|
|
||||||
void flopRun() {}
|
|
||||||
void turnRun() {}
|
|
||||||
void riverRun() {}
|
|
||||||
void postRiverRun() {}
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
HandInterface *myHand;
|
HandInterface *myHand;
|
||||||
|
|||||||
@@ -55,11 +55,6 @@ public:
|
|||||||
void postRiverRun();
|
void postRiverRun();
|
||||||
void nextPlayer2();
|
void nextPlayer2();
|
||||||
void distributePot();
|
void distributePot();
|
||||||
|
|
||||||
//only until bero refactory is over
|
|
||||||
void preflopRun() {}
|
|
||||||
void flopRun() {}
|
|
||||||
void turnRun() {}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
@@ -50,12 +50,6 @@ public:
|
|||||||
void nextPlayer2();
|
void nextPlayer2();
|
||||||
void turnRun();
|
void turnRun();
|
||||||
|
|
||||||
//only until bero refactory is over
|
|
||||||
void preflopRun() {}
|
|
||||||
void flopRun() {}
|
|
||||||
void riverRun() {}
|
|
||||||
void postRiverRun() {}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
HandInterface *myHand;
|
HandInterface *myHand;
|
||||||
|
|||||||
@@ -167,16 +167,16 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
|
|||||||
assignButtons();
|
assignButtons();
|
||||||
|
|
||||||
// Preflop, Flop, Turn und River erstellen
|
// Preflop, Flop, Turn und River erstellen
|
||||||
myPreflop = myFactory->createPreflop(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
|
// myPreflop = myFactory->createPreflop(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
|
||||||
myFlop = myFactory->createFlop(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
|
// myFlop = myFactory->createFlop(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
|
||||||
myTurn = myFactory->createTurn(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
|
// myTurn = myFactory->createTurn(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
|
||||||
myRiver = myFactory->createRiver(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
|
// myRiver = myFactory->createRiver(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
|
||||||
|
|
||||||
myBeRoFactory = myFactory->createBeRoFactory(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
|
myBeRoFactory = myFactory->createBeRoFactory(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
|
||||||
|
|
||||||
int currentRound = actualRound; // for Lothar ;-)
|
int currentRound = actualRound; // for Lothar ;-)
|
||||||
|
|
||||||
myBeRo = myBeRoFactory->switchRounds(currentRound);
|
myBeRo = myBeRoFactory->createBeRoPreflop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -330,11 +330,11 @@ void LocalHand::switchRounds() {
|
|||||||
switch (actualRound) {
|
switch (actualRound) {
|
||||||
case 0: {tempHighestSet = myBeRo->getHighestSet();}
|
case 0: {tempHighestSet = myBeRo->getHighestSet();}
|
||||||
break;
|
break;
|
||||||
case 1: {tempHighestSet = myFlop->getHighestSet();}
|
case 1: {tempHighestSet = myBeRo->getHighestSet();}
|
||||||
break;
|
break;
|
||||||
case 2: {tempHighestSet = myTurn->getHighestSet();}
|
case 2: {tempHighestSet = myBeRo->getHighestSet();}
|
||||||
break;
|
break;
|
||||||
case 3: {tempHighestSet = myRiver->getHighestSet();}
|
case 3: {tempHighestSet = myBeRo->getHighestSet();}
|
||||||
break;
|
break;
|
||||||
default: {}
|
default: {}
|
||||||
}
|
}
|
||||||
@@ -381,7 +381,10 @@ void LocalHand::switchRounds() {
|
|||||||
myGui->refreshGameLabels((GameState)getActualRound());
|
myGui->refreshGameLabels((GameState)getActualRound());
|
||||||
// /*/*/*/*cout <<*/*/*/*/ "NextPlayerSpeed1 stop" << endl;
|
// /*/*/*/*cout <<*/*/*/*/ "NextPlayerSpeed1 stop" << endl;
|
||||||
//
|
//
|
||||||
|
|
||||||
|
int currentRound = actualRound;
|
||||||
|
|
||||||
|
myBeRo = myBeRoFactory->switchRounds(myBeRo, currentRound);
|
||||||
|
|
||||||
// cout << "NextPlayerSpeed2 start" << endl;
|
// cout << "NextPlayerSpeed2 start" << endl;
|
||||||
switch(actualRound) {
|
switch(actualRound) {
|
||||||
|
|||||||
@@ -43,9 +43,9 @@ public:
|
|||||||
PlayerInterface** getPlayerArray() const { return playerArray; }
|
PlayerInterface** getPlayerArray() const { return playerArray; }
|
||||||
BoardInterface* getBoard() const { return myBoard; }
|
BoardInterface* getBoard() const { return myBoard; }
|
||||||
BeRoInterface* getPreflop() const { return myBeRo; }
|
BeRoInterface* getPreflop() const { return myBeRo; }
|
||||||
FlopInterface* getFlop() const { return myFlop; }
|
BeRoInterface* getFlop() const { return myBeRo; }
|
||||||
TurnInterface* getTurn() const { return myTurn; }
|
BeRoInterface* getTurn() const { return myBeRo; }
|
||||||
RiverInterface* getRiver() const { return myRiver; }
|
BeRoInterface* getRiver() const { return myBeRo; }
|
||||||
GuiInterface* getGuiInterface() const { return myGui; }
|
GuiInterface* getGuiInterface() const { return myGui; }
|
||||||
BeRoInterface* getCurrentBeRo() const { return myBeRo; }
|
BeRoInterface* getCurrentBeRo() const { return myBeRo; }
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
//
|
//
|
||||||
//
|
//
|
||||||
#include "clientberofactory.h"
|
#include "clientberofactory.h"
|
||||||
|
#include "berointerface.h"
|
||||||
|
|
||||||
ClientBeRoFactory::ClientBeRoFactory(HandInterface* hi, int id, int aP, int dP, int sB)
|
ClientBeRoFactory::ClientBeRoFactory(HandInterface* hi, int id, int aP, int dP, int sB)
|
||||||
: BeRoFactoryInterface()
|
: BeRoFactoryInterface()
|
||||||
@@ -22,4 +23,6 @@ ClientBeRoFactory::~ClientBeRoFactory()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BeRoInterface* ClientBeRoFactory::switchRounds(int currentRound) { return NULL;}
|
BeRoInterface* ClientBeRoFactory::switchRounds(BeRoInterface* currentBeRo, int currentRound) { return NULL;}
|
||||||
|
|
||||||
|
BeRoInterface* ClientBeRoFactory::createBeRoPreflop() { return NULL; }
|
||||||
|
|||||||
@@ -25,7 +25,9 @@ public:
|
|||||||
|
|
||||||
~ClientBeRoFactory();
|
~ClientBeRoFactory();
|
||||||
|
|
||||||
BeRoInterface* switchRounds(int);
|
BeRoInterface* switchRounds(BeRoInterface*, int);
|
||||||
|
|
||||||
|
BeRoInterface* createBeRoPreflop();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -78,3 +78,4 @@ BeRoFactoryInterface* ClientEngineFactory::createBeRoFactory(HandInterface* hi,
|
|||||||
{
|
{
|
||||||
return new ClientBeRoFactory(hi, id, aP, dP, sB);
|
return new ClientBeRoFactory(hi, id, aP, dP, sB);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,22 +90,22 @@ ClientHand::getPreflop() const
|
|||||||
return myBeRo;
|
return myBeRo;
|
||||||
}
|
}
|
||||||
|
|
||||||
FlopInterface*
|
BeRoInterface*
|
||||||
ClientHand::getFlop() const
|
ClientHand::getFlop() const
|
||||||
{
|
{
|
||||||
return myFlop;
|
return myBeRo;
|
||||||
}
|
}
|
||||||
|
|
||||||
TurnInterface*
|
BeRoInterface*
|
||||||
ClientHand::getTurn() const
|
ClientHand::getTurn() const
|
||||||
{
|
{
|
||||||
return myTurn;
|
return myBeRo;
|
||||||
}
|
}
|
||||||
|
|
||||||
RiverInterface*
|
BeRoInterface*
|
||||||
ClientHand::getRiver() const
|
ClientHand::getRiver() const
|
||||||
{
|
{
|
||||||
return myRiver;
|
return myBeRo;
|
||||||
}
|
}
|
||||||
|
|
||||||
BeRoInterface*
|
BeRoInterface*
|
||||||
|
|||||||
@@ -43,9 +43,9 @@ public:
|
|||||||
PlayerInterface** getPlayerArray() const;
|
PlayerInterface** getPlayerArray() const;
|
||||||
BoardInterface* getBoard() const;
|
BoardInterface* getBoard() const;
|
||||||
BeRoInterface* getPreflop() const;
|
BeRoInterface* getPreflop() const;
|
||||||
FlopInterface* getFlop() const;
|
BeRoInterface* getFlop() const;
|
||||||
TurnInterface* getTurn() const;
|
BeRoInterface* getTurn() const;
|
||||||
RiverInterface* getRiver() const;
|
BeRoInterface* getRiver() const;
|
||||||
GuiInterface* getGuiInterface() const;
|
GuiInterface* getGuiInterface() const;
|
||||||
BeRoInterface* getCurrentBeRo() const;
|
BeRoInterface* getCurrentBeRo() const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user