From 993465a2133cb8b9b8c00592c207cf3d7a9b6aab Mon Sep 17 00:00:00 2001 From: doitux Date: Sat, 4 Aug 2007 01:30:59 +0000 Subject: [PATCH] first polymorphie steps for BeRo (BettingRounds) --- pokerth.pro | 62 ++++++++++--------- src/engine/berointerface.cpp | 23 +++++++ src/engine/berointerface.h | 26 ++++++++ src/engine/local_engine/localbero.cpp | 23 +++++++ src/engine/local_engine/localbero.h | 28 +++++++++ .../local_engine/localenginefactory.cpp | 3 + src/engine/local_engine/localenginefactory.h | 2 + src/engine/network_engine/clientbero.cpp | 23 +++++++ src/engine/network_engine/clientbero.h | 26 ++++++++ 9 files changed, 188 insertions(+), 28 deletions(-) create mode 100644 src/engine/berointerface.cpp create mode 100644 src/engine/berointerface.h create mode 100644 src/engine/local_engine/localbero.cpp create mode 100644 src/engine/local_engine/localbero.h create mode 100644 src/engine/network_engine/clientbero.cpp create mode 100644 src/engine/network_engine/clientbero.h diff --git a/pokerth.pro b/pokerth.pro index 153ae087..e250cf4d 100755 --- a/pokerth.pro +++ b/pokerth.pro @@ -79,6 +79,7 @@ HEADERS += src/game.h \ src/engine/preflopinterface.h \ src/engine/riverinterface.h \ src/engine/turninterface.h \ + src/engine/berointerface.h \ src/gui/guiinterface.h \ src/net/clientcallback.h \ src/net/clientcontext.h \ @@ -105,6 +106,7 @@ HEADERS += src/game.h \ src/engine/local_engine/localriver.h \ src/engine/local_engine/localturn.h \ src/engine/local_engine/tools.h \ + src/engine/local_engine/localbero.h \ src/engine/network_engine/clientboard.h \ src/engine/network_engine/clientenginefactory.h \ src/engine/network_engine/clientflop.h \ @@ -113,7 +115,8 @@ HEADERS += src/game.h \ src/engine/network_engine/clientpreflop.h \ src/engine/network_engine/clientriver.h \ src/engine/network_engine/clientturn.h \ - src/gui/qt/sound/sdlplayer.h \ + src/engine/network_engine/clientbero.h \ + src/gui/qt/sound/sdlplayer.h \ src/gui/qt/mainwindow/mainwindowimpl.h \ src/gui/qt/mainwindow/mycardspixmaplabel.h \ src/gui/qt/mainwindow/mysetlabel.h \ @@ -139,7 +142,7 @@ HEADERS += src/game.h \ src/gui/qttoolsinterface.h \ src/gui/qt/qttools/qttoolswrapper.h \ src/gui/qt/qttools/qthelper/qthelper.h \ - src/gui/generic/serverguiwrapper.h + src/gui/generic/serverguiwrapper.h FORMS += src/gui/qt/mainwindow.ui \ src/gui/qt/aboutpokerth.ui \ src/gui/qt/connecttoserverdialog.ui \ @@ -164,6 +167,7 @@ SOURCES += src/game.cpp \ src/engine/preflopinterface.cpp \ src/engine/riverinterface.cpp \ src/engine/turninterface.cpp \ + src/engine/berointerface.cpp \ src/gui/guiinterface.cpp \ src/core/common/thread.cpp \ src/core/tinyxml/tinystr.cpp \ @@ -180,6 +184,7 @@ SOURCES += src/game.cpp \ src/engine/local_engine/localriver.cpp \ src/engine/local_engine/localturn.cpp \ src/engine/local_engine/tools.cpp \ + src/engine/local_engine/localbero.cpp \ src/engine/network_engine/clientboard.cpp \ src/engine/network_engine/clientenginefactory.cpp \ src/engine/network_engine/clientflop.cpp \ @@ -188,6 +193,7 @@ SOURCES += src/game.cpp \ src/engine/network_engine/clientpreflop.cpp \ src/engine/network_engine/clientriver.cpp \ src/engine/network_engine/clientturn.cpp \ + src/engine/network_engine/clientbero.cpp \ src/net/common/connectdata.cpp \ src/net/common/clientcallback.cpp \ src/net/common/clientcontext.cpp \ @@ -246,7 +252,7 @@ TRANSLATIONS = ts/pokerth_de.ts \ ts/pokerth_sk.ts \ ts/pokerth_eo.ts \ ts/pokerth_hu.ts \ - ts/pokerth_pl.ts \ + ts/pokerth_pl.ts \ ts/pokerth_ptbr.ts \ ts/pokerth_it.ts \ ts/pokerth_nl.ts @@ -272,39 +278,39 @@ win32{ src/net/linux/socket_startup.cpp } -unix:!mac{ - exists( /usr/lib/libboost_thread-mt.so ) { - message("Found libboost_thread-mt") - LIBS += -lboost_thread-mt - } - exists( /usr/lib/libboost_thread.so ) { - message("Found libboost_thread") - LIBS += -lboost_thread - } - LIBS += -lcrypto -lSDL_mixer - ## My release static libs - #LIBS += -lcrypto -lSDL_mixer -lSDL -lmikmod -} +unix: !mac{ + exists( /usr/lib/libboost_thread-mt.so ){ + message("Found libboost_thread-mt") + LIBS += -lboost_thread-mt + } + exists( /usr/lib/libboost_thread.so ){ + message("Found libboost_thread") + LIBS += -lboost_thread + } + LIBS += -lcrypto -lSDL_mixer + ## My release static libs + #LIBS += -lcrypto -lSDL_mixer -lSDL -lmikmod + } mac{ # make it universal CONFIG += x86 CONFIG += ppc - QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.3 - - # for universal-compilation on PPC-Mac uncomment the following line - # on Intel-Mac you have to comment this line out or build will fail. + QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.3 + + # for universal-compilation on PPC-Mac uncomment the following line + # on Intel-Mac you have to comment this line out or build will fail. # QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk/ # Qt static (path is standard for self-compiling qt) #LIBS += /usr/local/Trolltech/Qt-4.2.3/lib/libQtCore.a #LIBS += /usr/local/Trolltech/Qt-4.2.3/lib/libQtGui.a - # QT dynamic linked framework (see also mac_post_make.sh) - LIBS += -framework QtCore - LIBS += -framework QtGui - # SDL and SDL_mixer come as frameworks - LIBS += -framework SDL - LIBS += -framework SDL_mixer + # QT dynamic linked framework (see also mac_post_make.sh) + LIBS += -framework QtCore + LIBS += -framework QtGui + # SDL and SDL_mixer come as frameworks + LIBS += -framework SDL + LIBS += -framework SDL_mixer # standard path for darwinports # make sure you have a universal version of boost LIBS += /opt/local/lib/libboost_thread.a @@ -314,8 +320,8 @@ mac{ RC_FILE = pokerth.icns LIBPATH += /Developer/SDKs/MacOSX10.4u.sdk/usr/lib INCLUDEPATH += /Developer/SDKs/MacOSX10.4u.sdk/usr/include/ - INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers - INCLUDEPATH += /Library/Frameworks/SDL_mixer.framework/Headers + INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers + INCLUDEPATH += /Library/Frameworks/SDL_mixer.framework/Headers } CONFIG += qt release diff --git a/src/engine/berointerface.cpp b/src/engine/berointerface.cpp new file mode 100644 index 00000000..fab3f92e --- /dev/null +++ b/src/engine/berointerface.cpp @@ -0,0 +1,23 @@ +// +// C++ Implementation: berointerface +// +// Description: +// +// +// Author: FThauer FHammer , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "berointerface.h" + +BeRoInterface::BeRoInterface() +{ +} + + +BeRoInterface::~BeRoInterface() +{ +} + + diff --git a/src/engine/berointerface.h b/src/engine/berointerface.h new file mode 100644 index 00000000..54b7cb83 --- /dev/null +++ b/src/engine/berointerface.h @@ -0,0 +1,26 @@ +// +// C++ Interface: berointerface +// +// Description: +// +// +// Author: FThauer FHammer , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef BEROINTERFACE_H +#define BEROINTERFACE_H + +/** + @author FThauer FHammer +*/ +class BeRoInterface{ +public: + BeRoInterface(); + + ~BeRoInterface(); + +}; + +#endif diff --git a/src/engine/local_engine/localbero.cpp b/src/engine/local_engine/localbero.cpp new file mode 100644 index 00000000..32b368b7 --- /dev/null +++ b/src/engine/local_engine/localbero.cpp @@ -0,0 +1,23 @@ +// +// C++ Implementation: localbero +// +// Description: +// +// +// Author: FThauer FHammer , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "localbero.h" + +LocalBeRo::LocalBeRo() : BeRoInterface() +{ +} + + +LocalBeRo::~LocalBeRo() +{ +} + + diff --git a/src/engine/local_engine/localbero.h b/src/engine/local_engine/localbero.h new file mode 100644 index 00000000..47202eb9 --- /dev/null +++ b/src/engine/local_engine/localbero.h @@ -0,0 +1,28 @@ +// +// C++ Interface: localbero +// +// Description: +// +// +// Author: FThauer FHammer , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef LOCALBERO_H +#define LOCALBERO_H + +#include "berointerface.h" + +/** + @author FThauer FHammer +*/ +class LocalBeRo : public BeRoInterface{ +public: + LocalBeRo(); + + ~LocalBeRo(); + +}; + +#endif diff --git a/src/engine/local_engine/localenginefactory.cpp b/src/engine/local_engine/localenginefactory.cpp index c53ce0c4..d60e886e 100644 --- a/src/engine/local_engine/localenginefactory.cpp +++ b/src/engine/local_engine/localenginefactory.cpp @@ -26,6 +26,7 @@ #include "localflop.h" #include "localturn.h" #include "localriver.h" +#include "localbero.h" #include @@ -54,3 +55,5 @@ FlopInterface* LocalEngineFactory::createFlop(HandInterface* hi, int id, int aP, 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); } + +BeRoInterface* LocalEngineFactory::createBeRo() { return new LocalBeRo(); } \ No newline at end of file diff --git a/src/engine/local_engine/localenginefactory.h b/src/engine/local_engine/localenginefactory.h index c4ad2f4a..0a6a6545 100644 --- a/src/engine/local_engine/localenginefactory.h +++ b/src/engine/local_engine/localenginefactory.h @@ -29,6 +29,7 @@ #include #include #include +#include class ConfigFile; @@ -45,6 +46,7 @@ public: 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); + BeRoInterface* createBeRo(); private: ConfigFile *myConfig; diff --git a/src/engine/network_engine/clientbero.cpp b/src/engine/network_engine/clientbero.cpp new file mode 100644 index 00000000..057634d1 --- /dev/null +++ b/src/engine/network_engine/clientbero.cpp @@ -0,0 +1,23 @@ +// +// C++ Implementation: clientbero +// +// Description: +// +// +// Author: FThauer FHammer , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "clientbero.h" + +ClientBeRo::ClientBeRo() +{ +} + + +ClientBeRo::~ClientBeRo() +{ +} + + diff --git a/src/engine/network_engine/clientbero.h b/src/engine/network_engine/clientbero.h new file mode 100644 index 00000000..33e42936 --- /dev/null +++ b/src/engine/network_engine/clientbero.h @@ -0,0 +1,26 @@ +// +// C++ Interface: clientbero +// +// Description: +// +// +// Author: FThauer FHammer , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef CLIENTBERO_H +#define CLIENTBERO_H + +/** + @author FThauer FHammer +*/ +class ClientBeRo{ +public: + ClientBeRo(); + + ~ClientBeRo(); + +}; + +#endif