diff --git a/pokerth.pro b/pokerth.pro index 968cbdd7..f62499ed 100755 --- a/pokerth.pro +++ b/pokerth.pro @@ -78,7 +78,6 @@ HEADERS += src/game.h \ src/engine/riverinterface.h \ src/engine/turninterface.h \ src/engine/berointerface.h \ - src/engine/berofactoryinterface.h \ src/gui/guiinterface.h \ src/net/clientcallback.h \ src/net/clientcontext.h \ @@ -111,7 +110,6 @@ HEADERS += src/game.h \ src/engine/local_engine/localberoturn.h \ src/engine/local_engine/tools.h \ src/engine/local_engine/localbero.h \ - src/engine/local_engine/localberofactory.h \ src/engine/network_engine/clientboard.h \ src/engine/network_engine/clientenginefactory.h \ src/engine/network_engine/clientflop.h \ @@ -121,7 +119,6 @@ HEADERS += src/game.h \ src/engine/network_engine/clientriver.h \ src/engine/network_engine/clientturn.h \ src/engine/network_engine/clientbero.h \ - src/engine/network_engine/clientberofactory.h \ src/gui/qt/sound/sdlplayer.h \ src/gui/qt/mainwindow/mainwindowimpl.h \ src/gui/qt/mainwindow/mycardspixmaplabel.h \ @@ -172,7 +169,6 @@ SOURCES += src/game.cpp \ src/engine/riverinterface.cpp \ src/engine/turninterface.cpp \ src/engine/berointerface.cpp \ - src/engine/berofactoryinterface.cpp \ src/gui/guiinterface.cpp \ src/core/common/thread.cpp \ src/core/tinyxml/tinystr.cpp \ @@ -195,7 +191,6 @@ SOURCES += src/game.cpp \ src/engine/local_engine/localberoturn.cpp \ src/engine/local_engine/tools.cpp \ src/engine/local_engine/localbero.cpp \ - src/engine/local_engine/localberofactory.cpp \ src/engine/network_engine/clientboard.cpp \ src/engine/network_engine/clientenginefactory.cpp \ src/engine/network_engine/clientflop.cpp \ @@ -205,7 +200,6 @@ SOURCES += src/game.cpp \ src/engine/network_engine/clientriver.cpp \ src/engine/network_engine/clientturn.cpp \ src/engine/network_engine/clientbero.cpp \ - src/engine/network_engine/clientberofactory.cpp \ src/net/common/connectdata.cpp \ src/net/common/clientcallback.cpp \ src/net/common/clientcontext.cpp \ diff --git a/src/engine/berofactoryinterface.cpp b/src/engine/berofactoryinterface.cpp deleted file mode 100644 index 4d3f27ae..00000000 --- a/src/engine/berofactoryinterface.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// -// C++ Implementation: berofactoryinterface -// -// Description: -// -// -// Author: FThauer FHammer , (C) 2007 -// -// Copyright: See COPYING file that comes with this distribution -// -// -#include "berofactoryinterface.h" - -BeRoFactoryInterface::~BeRoFactoryInterface() -{ -} - - diff --git a/src/engine/berofactoryinterface.h b/src/engine/berofactoryinterface.h deleted file mode 100644 index 49fdc52d..00000000 --- a/src/engine/berofactoryinterface.h +++ /dev/null @@ -1,38 +0,0 @@ -// -// C++ Interface: berofactoryinterface -// -// Description: -// -// -// Author: FThauer FHammer , (C) 2007 -// -// Copyright: See COPYING file that comes with this distribution -// -// -#ifndef BEROFACTORYINTERFACE_H -#define BEROFACTORYINTERFACE_H - -/** - @author FThauer FHammer -*/ - -#include - -#include - -#include - -class BeRoFactoryInterface{ -public: - - virtual ~BeRoFactoryInterface(); - - virtual BeRoInterface* switchRounds(BeRoInterface*, int) = 0; - - virtual BeRoInterface* createBeRoPreflop() =0; - - virtual std::vector > createBeRo() =0; - -}; - -#endif diff --git a/src/engine/berointerface.h b/src/engine/berointerface.h index a61a7c05..9fd78add 100644 --- a/src/engine/berointerface.h +++ b/src/engine/berointerface.h @@ -34,10 +34,12 @@ public: virtual void run() =0; + // for network virtual void preflopRun() =0; virtual void flopRun() =0; virtual void turnRun() =0; virtual void riverRun() =0; + virtual void postRiverRun() =0; virtual void nextPlayer2() =0; diff --git a/src/engine/enginefactory.h b/src/engine/enginefactory.h index 76c398b3..7140ffb4 100644 --- a/src/engine/enginefactory.h +++ b/src/engine/enginefactory.h @@ -23,12 +23,7 @@ #include "boardinterface.h" #include "handinterface.h" #include "playerinterface.h" -#include "preflopinterface.h" -#include "flopinterface.h" -#include "turninterface.h" -#include "riverinterface.h" #include "berointerface.h" -#include "berofactoryinterface.h" #include @@ -41,12 +36,6 @@ public: virtual HandInterface* createHand(boost::shared_ptr f, GuiInterface *g, BoardInterface *b, PlayerInterface **p, int id, int sP, int aP, int dP, int sB,int sC) =0; virtual BoardInterface* createBoard() =0; virtual PlayerInterface* createPlayer(BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB) =0; - virtual PreflopInterface* createPreflop(HandInterface* hi, int id, int aP, int dP, int sB) =0; - virtual FlopInterface* createFlop(HandInterface* hi, int id, int aP, int dP, int sB) =0; - virtual TurnInterface* createTurn(HandInterface* hi, int id, int aP, int dP, int sB) =0; - virtual RiverInterface* createRiver(HandInterface* hi, int id, int aP, int dP, int sB) =0; -// virtual BeRoInterface* createBeRo() =0; - virtual BeRoFactoryInterface* createBeRoFactory(HandInterface* hi, int id, int aP, int dP, int sB) =0; virtual std::vector > createBeRo(HandInterface* hi, int id, int aP, int dP, int sB) =0; }; diff --git a/src/engine/local_engine/localberofactory.cpp b/src/engine/local_engine/localberofactory.cpp deleted file mode 100644 index cbc2823d..00000000 --- a/src/engine/local_engine/localberofactory.cpp +++ /dev/null @@ -1,101 +0,0 @@ -// -// C++ Implementation: localberofactory -// -// Description: -// -// -// Author: FThauer FHammer , (C) 2007 -// -// Copyright: See COPYING file that comes with this distribution -// -// -#include "localberofactory.h" - -#include -#include -#include -#include -#include - -using namespace std; - -LocalBeRoFactory::LocalBeRoFactory (HandInterface* hi, int id, int aP, int dP, int sB) - : BeRoFactoryInterface() , myHand(hi), myID(id), actualQuantityPlayers(aP), dealerPosition(dP), smallBlind(sB) -{} - - -LocalBeRoFactory::~LocalBeRoFactory() -{} - -std::vector > LocalBeRoFactory::createBeRo() { - - std::vector > myBeRo; - - myBeRo.push_back(boost::shared_ptr(new LocalBeRoPreflop(myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind))); - - myBeRo.push_back(boost::shared_ptr(new LocalBeRoFlop(myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind))); - - myBeRo.push_back(boost::shared_ptr(new LocalBeRoTurn(myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind))); - - myBeRo.push_back(boost::shared_ptr(new LocalBeRoRiver(myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind))); - - myBeRo.push_back(boost::shared_ptr(new LocalBeRoPostRiver(myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind))); - - return myBeRo; - -} - -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()) { - - delete currentBeRo; - currentBeRo = NULL; - - switch(currentRound) { - case GAME_STATE_PREFLOP: { - - currentBeRo = new LocalBeRoPreflop ( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind ); - } - break; - case GAME_STATE_FLOP: { - - currentBeRo = new LocalBeRoFlop( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind ); - } - break; - case GAME_STATE_TURN: { - - currentBeRo = new LocalBeRoTurn( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind ); - - } - break; - case GAME_STATE_RIVER: { - - currentBeRo = new LocalBeRoRiver ( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind ); - - } - break; - case GAME_STATE_POST_RIVER: { - - currentBeRo = new LocalBeRoPostRiver ( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind ); - - } - break; - default: { cout << "BeRoFactory-ERROR" << endl; } - } - - } - - return currentBeRo; -} - - - diff --git a/src/engine/local_engine/localberofactory.h b/src/engine/local_engine/localberofactory.h deleted file mode 100644 index 65079c11..00000000 --- a/src/engine/local_engine/localberofactory.h +++ /dev/null @@ -1,59 +0,0 @@ -// -// C++ Interface: localberofactory -// -// Description: -// -// -// Author: FThauer FHammer , (C) 2007 -// -// Copyright: See COPYING file that comes with this distribution -// -// -#ifndef LOCALBEROFACTORY_H -#define LOCALBEROFACTORY_H - -#include - -#include - -#include - -#include -#include -#include - -/** - @author FThauer FHammer -*/ -class LocalBeRoFactory : public BeRoFactoryInterface -{ -public: - LocalBeRoFactory(HandInterface* hi, int id, int aP, int dP, int sB); - - ~LocalBeRoFactory(); - - BeRoInterface* switchRounds(BeRoInterface*, int); - - BeRoInterface* createBeRoPreflop(); - - std::vector > createBeRo(); - - -private: - - HandInterface* myHand; - - int myID; - int actualQuantityPlayers; - int dealerPosition; - int bigBlindPosition; - - int smallBlind; - int highestSet; - - bool preflopFirstRound; - int playersTurn; - -}; - -#endif diff --git a/src/engine/local_engine/localenginefactory.cpp b/src/engine/local_engine/localenginefactory.cpp index 81846726..bafa3c1e 100644 --- a/src/engine/local_engine/localenginefactory.cpp +++ b/src/engine/local_engine/localenginefactory.cpp @@ -22,11 +22,6 @@ #include "localhand.h" #include "localboard.h" #include "localplayer.h" -#include "localpreflop.h" -#include "localflop.h" -#include "localturn.h" -#include "localriver.h" -#include "localberofactory.h" #include "localberopreflop.h" #include "localberoflop.h" #include "localberoturn.h" @@ -53,16 +48,6 @@ BoardInterface* LocalEngineFactory::createBoard() { return new LocalBoard; } PlayerInterface* LocalEngineFactory::createPlayer(BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB) { return new LocalPlayer(myConfig, b, id, uniqueId, type, name, avatar, sC, aS, mB); } -PreflopInterface* LocalEngineFactory::createPreflop(HandInterface* hi, int id, int aP, int dP, int sB) { return new LocalPreflop(hi, id, aP, dP, sB); } - -FlopInterface* LocalEngineFactory::createFlop(HandInterface* hi, int id, int aP, int dP, int sB) { return new LocalFlop(hi, id, aP, dP, sB); } - -TurnInterface* LocalEngineFactory::createTurn(HandInterface* hi, int id, int aP, int dP, int sB) { return new LocalTurn(hi, id, aP, dP, sB); } - -RiverInterface* LocalEngineFactory::createRiver(HandInterface* hi, int id, int aP, int dP, int sB) { return new LocalRiver(hi, id, aP, dP, sB); } - -BeRoFactoryInterface* LocalEngineFactory::createBeRoFactory(HandInterface* hi, int id, int aP, int dP, int sB) { return new LocalBeRoFactory(hi, id, aP, dP, sB); } - std::vector > LocalEngineFactory::createBeRo(HandInterface* hi, int id, int aP, int dP, int sB) { std::vector > myBeRo; diff --git a/src/engine/local_engine/localenginefactory.h b/src/engine/local_engine/localenginefactory.h index 4bcc41d4..d9e0f550 100644 --- a/src/engine/local_engine/localenginefactory.h +++ b/src/engine/local_engine/localenginefactory.h @@ -25,11 +25,6 @@ #include #include #include -#include -#include -#include -#include -#include class ConfigFile; @@ -42,11 +37,6 @@ public: HandInterface* createHand(boost::shared_ptr f, GuiInterface *g, BoardInterface *b, PlayerInterface **p, int id, int sP, int aP, int dP, int sB,int sC); BoardInterface* createBoard(); PlayerInterface* createPlayer(BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB); - PreflopInterface* createPreflop(HandInterface* hi, int id, int aP, int dP, int sB); - FlopInterface* createFlop(HandInterface* hi, int id, int aP, int dP, int sB); - TurnInterface* createTurn(HandInterface* hi, int id, int aP, int dP, int sB); - RiverInterface* createRiver(HandInterface* hi, int id, int aP, int dP, int sB); - BeRoFactoryInterface* createBeRoFactory(HandInterface* hi, int id, int aP, int dP, int sB); std::vector > createBeRo(HandInterface* hi, int id, int aP, int dP, int sB); private: diff --git a/src/engine/local_engine/localhand.h b/src/engine/local_engine/localhand.h index f94baf47..ffb11a17 100755 --- a/src/engine/local_engine/localhand.h +++ b/src/engine/local_engine/localhand.h @@ -30,7 +30,6 @@ #include #include #include -#include class LocalHand : public HandInterface{ @@ -96,7 +95,6 @@ private: GuiInterface *myGui; BoardInterface *myBoard; PlayerInterface **playerArray; - BeRoFactoryInterface *myBeRoFactory; std::vector > myBeRo; int myID; diff --git a/src/engine/network_engine/clientberofactory.cpp b/src/engine/network_engine/clientberofactory.cpp deleted file mode 100644 index 3728490c..00000000 --- a/src/engine/network_engine/clientberofactory.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// -// C++ Implementation: clientberofactory -// -// Description: -// -// -// Author: FThauer FHammer , (C) 2007 -// -// Copyright: See COPYING file that comes with this distribution -// -// -#include "clientberofactory.h" -#include -#include -#include -#include - -ClientBeRoFactory::ClientBeRoFactory(HandInterface* hi, int id, int aP, int dP, int sB) -: myHand(hi), myID(id), actualQuantityPlayers(aP), dealerPosition(dP), smallBlind(sB) -{ -} - - -ClientBeRoFactory::~ClientBeRoFactory() -{ -} - -std::vector > ClientBeRoFactory::createBeRo() -{ - std::vector > myBeRo; - - myBeRo.push_back(boost::shared_ptr(new ClientBeRoPreflop(myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind))); - - myBeRo.push_back(boost::shared_ptr(new ClientBeRoFlop(myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind))); - - myBeRo.push_back(boost::shared_ptr(new ClientBeRoTurn(myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind))); - - myBeRo.push_back(boost::shared_ptr(new ClientBeRoRiver(myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind))); - -// myBeRo.push_back(boost::shared_ptr(new ClientBeRoPostRiver(myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind))); - - return myBeRo; -} - - - -BeRoInterface* ClientBeRoFactory::switchRounds(BeRoInterface* currentBeRo, int currentRound) { return NULL;} - -BeRoInterface* ClientBeRoFactory::createBeRoPreflop() { return NULL; } diff --git a/src/engine/network_engine/clientberofactory.h b/src/engine/network_engine/clientberofactory.h deleted file mode 100644 index 37c80c96..00000000 --- a/src/engine/network_engine/clientberofactory.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// C++ Interface: clientberofactory -// -// Description: -// -// -// Author: FThauer FHammer , (C) 2007 -// -// Copyright: See COPYING file that comes with this distribution -// -// -#ifndef CLIENTBEROFACTORY_H -#define CLIENTBEROFACTORY_H - -#include - -#include - -#include -#include - -/** - @author FThauer FHammer -*/ -class ClientBeRoFactory : public BeRoFactoryInterface -{ -public: - ClientBeRoFactory(HandInterface* hi, int id, int aP, int dP, int sB); - - ~ClientBeRoFactory(); - - BeRoInterface* switchRounds(BeRoInterface*, int); - - BeRoInterface* createBeRoPreflop(); - - std::vector > createBeRo(); - -private: - - HandInterface* myHand; - - int myID; - int actualQuantityPlayers; - int dealerPosition; - int smallBlind; -}; - -#endif diff --git a/src/engine/network_engine/clientenginefactory.cpp b/src/engine/network_engine/clientenginefactory.cpp index f6e9b6cc..7f19b2ba 100644 --- a/src/engine/network_engine/clientenginefactory.cpp +++ b/src/engine/network_engine/clientenginefactory.cpp @@ -25,7 +25,6 @@ #include "clientflop.h" #include "clientturn.h" #include "clientriver.h" -#include "clientberofactory.h" @@ -54,31 +53,6 @@ PlayerInterface* ClientEngineFactory::createPlayer(BoardInterface *b, int id, un return new ClientPlayer(NULL, b, id, uniqueId, type, name, avatar, sC, aS, mB); } -PreflopInterface* ClientEngineFactory::createPreflop(HandInterface* hi, int id, int aP, int dP, int sB) -{ - return NULL; -} - -FlopInterface* ClientEngineFactory::createFlop(HandInterface* hi, int id, int aP, int dP, int sB) -{ - return NULL; -} - -TurnInterface* ClientEngineFactory::createTurn(HandInterface* hi, int id, int aP, int dP, int sB) -{ - return NULL; -} - -RiverInterface* ClientEngineFactory::createRiver(HandInterface* hi, int id, int aP, int dP, int sB) -{ - return NULL; -} - -BeRoFactoryInterface* ClientEngineFactory::createBeRoFactory(HandInterface* hi, int id, int aP, int dP, int sB) -{ - return new ClientBeRoFactory(hi, id, aP, dP, sB); -} - std::vector > ClientEngineFactory::createBeRo(HandInterface* hi, int id, int aP, int dP, int sB) { std::vector > myBeRo; diff --git a/src/engine/network_engine/clientenginefactory.h b/src/engine/network_engine/clientenginefactory.h index 4544dc2e..cb88ec33 100644 --- a/src/engine/network_engine/clientenginefactory.h +++ b/src/engine/network_engine/clientenginefactory.h @@ -24,12 +24,6 @@ #include #include #include -#include -#include -#include -#include -// #include - class ConfigFile; @@ -42,11 +36,6 @@ public: HandInterface* createHand(boost::shared_ptr f, GuiInterface *g, BoardInterface *b, PlayerInterface **p, int id, int sP, int aP, int dP, int sB,int sC); BoardInterface* createBoard(); PlayerInterface* createPlayer(BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB); - PreflopInterface* createPreflop(HandInterface* hi, int id, int aP, int dP, int sB); - FlopInterface* createFlop(HandInterface* hi, int id, int aP, int dP, int sB); - TurnInterface* createTurn(HandInterface* hi, int id, int aP, int dP, int sB); - RiverInterface* createRiver(HandInterface* hi, int id, int aP, int dP, int sB); - BeRoFactoryInterface* createBeRoFactory(HandInterface* hi, int id, int aP, int dP, int sB); std::vector > createBeRo(HandInterface* hi, int id, int aP, int dP, int sB); }; diff --git a/src/engine/network_engine/clienthand.cpp b/src/engine/network_engine/clienthand.cpp index 0355356a..4eeb075a 100644 --- a/src/engine/network_engine/clienthand.cpp +++ b/src/engine/network_engine/clienthand.cpp @@ -55,7 +55,7 @@ ClientHand::ClientHand(boost::shared_ptr f, GuiInterface *g, Boar // the rest of the buttons are assigned later as received from the server. // Preflop, Flop, Turn und River erstellen - myBeRo = myFactory->createBeRoFactory(this, myID, actualQuantityPlayers, dealerPosition, smallBlind)->createBeRo(); + myBeRo = myFactory->createBeRo(this, myID, actualQuantityPlayers, dealerPosition, smallBlind); }