From 1f00b3f458eca6fdeb6ffe39d41791b745676052 Mon Sep 17 00:00:00 2001 From: doitux Date: Sat, 4 Aug 2007 12:08:10 +0000 Subject: [PATCH] more polymorphie steps for BeRo --- pokerth.pro | 8 ++++- src/engine/berofactoryinterface.cpp | 23 +++++++++++++++ src/engine/berofactoryinterface.h | 26 +++++++++++++++++ src/engine/enginefactory.h | 2 ++ src/engine/local_engine/localberofactory.cpp | 24 +++++++++++++++ src/engine/local_engine/localberofactory.h | 29 +++++++++++++++++++ .../local_engine/localenginefactory.cpp | 6 +++- src/engine/local_engine/localenginefactory.h | 2 ++ .../network_engine/clientberofactory.cpp | 24 +++++++++++++++ src/engine/network_engine/clientberofactory.h | 29 +++++++++++++++++++ .../network_engine/clientenginefactory.cpp | 6 ++++ .../network_engine/clientenginefactory.h | 2 ++ 12 files changed, 179 insertions(+), 2 deletions(-) create mode 100644 src/engine/berofactoryinterface.cpp create mode 100644 src/engine/berofactoryinterface.h create mode 100644 src/engine/local_engine/localberofactory.cpp create mode 100644 src/engine/local_engine/localberofactory.h create mode 100644 src/engine/network_engine/clientberofactory.cpp create mode 100644 src/engine/network_engine/clientberofactory.h diff --git a/pokerth.pro b/pokerth.pro index e250cf4d..a914bc48 100755 --- a/pokerth.pro +++ b/pokerth.pro @@ -80,6 +80,7 @@ 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 \ @@ -107,6 +108,7 @@ HEADERS += src/game.h \ src/engine/local_engine/localturn.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 \ @@ -116,6 +118,7 @@ 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 \ @@ -168,6 +171,7 @@ 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 \ @@ -185,6 +189,7 @@ SOURCES += src/game.cpp \ src/engine/local_engine/localturn.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 \ @@ -194,6 +199,7 @@ 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 \ @@ -242,7 +248,7 @@ SOURCES += src/game.cpp \ src/gui/qttoolsinterface.cpp \ src/gui/qt/qttools/qttoolswrapper.cpp \ src/gui/qt/qttools/qthelper/qthelper.cpp \ - src/gui/generic/serverguiwrapper.cpp + src/gui/generic/serverguiwrapper.cpp RESOURCES += src/gui/qt/resources.qrc TRANSLATIONS = ts/pokerth_de.ts \ ts/pokerth_es.ts \ diff --git a/src/engine/berofactoryinterface.cpp b/src/engine/berofactoryinterface.cpp new file mode 100644 index 00000000..60ec14d9 --- /dev/null +++ b/src/engine/berofactoryinterface.cpp @@ -0,0 +1,23 @@ +// +// C++ Implementation: berofactoryinterface +// +// Description: +// +// +// Author: FThauer FHammer , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "berofactoryinterface.h" + +BeRoFactoryInterface::BeRoFactoryInterface() +{ +} + + +BeRoFactoryInterface::~BeRoFactoryInterface() +{ +} + + diff --git a/src/engine/berofactoryinterface.h b/src/engine/berofactoryinterface.h new file mode 100644 index 00000000..01b0e656 --- /dev/null +++ b/src/engine/berofactoryinterface.h @@ -0,0 +1,26 @@ +// +// 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 +*/ +class BeRoFactoryInterface{ +public: + BeRoFactoryInterface(); + + ~BeRoFactoryInterface(); + +}; + +#endif diff --git a/src/engine/enginefactory.h b/src/engine/enginefactory.h index 92f2eb01..c49c4e28 100644 --- a/src/engine/enginefactory.h +++ b/src/engine/enginefactory.h @@ -28,6 +28,7 @@ #include "turninterface.h" #include "riverinterface.h" #include "berointerface.h" +#include "berofactoryinterface.h" #include @@ -45,6 +46,7 @@ public: 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() =0; }; #endif diff --git a/src/engine/local_engine/localberofactory.cpp b/src/engine/local_engine/localberofactory.cpp new file mode 100644 index 00000000..ba2a38fb --- /dev/null +++ b/src/engine/local_engine/localberofactory.cpp @@ -0,0 +1,24 @@ +// +// C++ Implementation: localberofactory +// +// Description: +// +// +// Author: FThauer FHammer , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "localberofactory.h" + +LocalBeRoFactory::LocalBeRoFactory() + : BeRoFactoryInterface() +{ +} + + +LocalBeRoFactory::~LocalBeRoFactory() +{ +} + + diff --git a/src/engine/local_engine/localberofactory.h b/src/engine/local_engine/localberofactory.h new file mode 100644 index 00000000..84b2a380 --- /dev/null +++ b/src/engine/local_engine/localberofactory.h @@ -0,0 +1,29 @@ +// +// 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 + +/** + @author FThauer FHammer +*/ +class LocalBeRoFactory : public BeRoFactoryInterface +{ +public: + LocalBeRoFactory(); + + ~LocalBeRoFactory(); + +}; + +#endif diff --git a/src/engine/local_engine/localenginefactory.cpp b/src/engine/local_engine/localenginefactory.cpp index d60e886e..d21b04a5 100644 --- a/src/engine/local_engine/localenginefactory.cpp +++ b/src/engine/local_engine/localenginefactory.cpp @@ -27,6 +27,7 @@ #include "localturn.h" #include "localriver.h" #include "localbero.h" +#include "localberofactory.h" #include @@ -56,4 +57,7 @@ TurnInterface* LocalEngineFactory::createTurn(HandInterface* hi, int id, int aP, 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 +BeRoInterface* LocalEngineFactory::createBeRo() { return new LocalBeRo(); } + +BeRoFactoryInterface* LocalEngineFactory::createBeRoFactory() { return new LocalBeRoFactory(); } + diff --git a/src/engine/local_engine/localenginefactory.h b/src/engine/local_engine/localenginefactory.h index 0a6a6545..bd09bc3e 100644 --- a/src/engine/local_engine/localenginefactory.h +++ b/src/engine/local_engine/localenginefactory.h @@ -30,6 +30,7 @@ #include #include #include +#include class ConfigFile; @@ -47,6 +48,7 @@ public: 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(); + BeRoFactoryInterface* createBeRoFactory(); private: ConfigFile *myConfig; diff --git a/src/engine/network_engine/clientberofactory.cpp b/src/engine/network_engine/clientberofactory.cpp new file mode 100644 index 00000000..7afb50c5 --- /dev/null +++ b/src/engine/network_engine/clientberofactory.cpp @@ -0,0 +1,24 @@ +// +// C++ Implementation: clientberofactory +// +// Description: +// +// +// Author: FThauer FHammer , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "clientberofactory.h" + +ClientBeRoFactory::ClientBeRoFactory() + : BeRoFactoryInterface() +{ +} + + +ClientBeRoFactory::~ClientBeRoFactory() +{ +} + + diff --git a/src/engine/network_engine/clientberofactory.h b/src/engine/network_engine/clientberofactory.h new file mode 100644 index 00000000..e9ca2ef7 --- /dev/null +++ b/src/engine/network_engine/clientberofactory.h @@ -0,0 +1,29 @@ +// +// 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 + +/** + @author FThauer FHammer +*/ +class ClientBeRoFactory : public BeRoFactoryInterface +{ +public: + ClientBeRoFactory(); + + ~ClientBeRoFactory(); + +}; + +#endif diff --git a/src/engine/network_engine/clientenginefactory.cpp b/src/engine/network_engine/clientenginefactory.cpp index 53264b16..c33b44a7 100644 --- a/src/engine/network_engine/clientenginefactory.cpp +++ b/src/engine/network_engine/clientenginefactory.cpp @@ -26,6 +26,7 @@ #include "clientturn.h" #include "clientriver.h" #include "clientbero.h" +#include "clientberofactory.h" @@ -78,3 +79,8 @@ BeRoInterface* ClientEngineFactory::createBeRo() { return new ClientBeRo(); } + +BeRoFactoryInterface* ClientEngineFactory::createBeRoFactory() +{ + return new ClientBeRoFactory(); +} diff --git a/src/engine/network_engine/clientenginefactory.h b/src/engine/network_engine/clientenginefactory.h index e740d942..f3bb838b 100644 --- a/src/engine/network_engine/clientenginefactory.h +++ b/src/engine/network_engine/clientenginefactory.h @@ -29,6 +29,7 @@ #include #include #include +#include class ConfigFile; @@ -47,6 +48,7 @@ public: 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(); + BeRoFactoryInterface* createBeRoFactory(); };