From 421ca6c62d006fc4d339252afb0853df1403975c Mon Sep 17 00:00:00 2001 From: doitux Date: Sat, 4 Aug 2007 11:37:26 +0000 Subject: [PATCH] more polymorphie steps for BeRo --- src/engine/enginefactory.h | 3 ++- src/engine/local_engine/localhand.cpp | 2 ++ src/engine/local_engine/localhand.h | 2 ++ src/engine/network_engine/clientbero.cpp | 2 +- src/engine/network_engine/clientbero.h | 5 ++++- src/engine/network_engine/clientenginefactory.cpp | 6 ++++++ src/engine/network_engine/clientenginefactory.h | 4 ++++ 7 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/engine/enginefactory.h b/src/engine/enginefactory.h index b113d06d..92f2eb01 100644 --- a/src/engine/enginefactory.h +++ b/src/engine/enginefactory.h @@ -27,6 +27,7 @@ #include "flopinterface.h" #include "turninterface.h" #include "riverinterface.h" +#include "berointerface.h" #include @@ -43,7 +44,7 @@ public: 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; }; #endif diff --git a/src/engine/local_engine/localhand.cpp b/src/engine/local_engine/localhand.cpp index 77e1be46..b3a36604 100755 --- a/src/engine/local_engine/localhand.cpp +++ b/src/engine/local_engine/localhand.cpp @@ -171,6 +171,8 @@ LocalHand::LocalHand(boost::shared_ptr f, GuiInterface *g, BoardI myFlop = myFactory->createFlop(this, myID, actualQuantityPlayers, dealerPosition, smallBlind); myTurn = myFactory->createTurn(this, myID, actualQuantityPlayers, dealerPosition, smallBlind); myRiver = myFactory->createRiver(this, myID, actualQuantityPlayers, dealerPosition, smallBlind); + + myBeRo = myFactory->createBeRo(); } diff --git a/src/engine/local_engine/localhand.h b/src/engine/local_engine/localhand.h index 6098b21f..df163e6f 100755 --- a/src/engine/local_engine/localhand.h +++ b/src/engine/local_engine/localhand.h @@ -29,6 +29,7 @@ #include #include #include +#include class LocalHand : public HandInterface{ @@ -97,6 +98,7 @@ private: FlopInterface *myFlop; TurnInterface *myTurn; RiverInterface *myRiver; + BeRoInterface *myBeRo; int myID; int actualQuantityPlayers; diff --git a/src/engine/network_engine/clientbero.cpp b/src/engine/network_engine/clientbero.cpp index 057634d1..cb48465e 100644 --- a/src/engine/network_engine/clientbero.cpp +++ b/src/engine/network_engine/clientbero.cpp @@ -11,7 +11,7 @@ // #include "clientbero.h" -ClientBeRo::ClientBeRo() +ClientBeRo::ClientBeRo() : BeRoInterface() { } diff --git a/src/engine/network_engine/clientbero.h b/src/engine/network_engine/clientbero.h index 33e42936..8bddb041 100644 --- a/src/engine/network_engine/clientbero.h +++ b/src/engine/network_engine/clientbero.h @@ -12,10 +12,13 @@ #ifndef CLIENTBERO_H #define CLIENTBERO_H +#include "berointerface.h" + + /** @author FThauer FHammer */ -class ClientBeRo{ +class ClientBeRo : public BeRoInterface{ public: ClientBeRo(); diff --git a/src/engine/network_engine/clientenginefactory.cpp b/src/engine/network_engine/clientenginefactory.cpp index 1ff54ad8..53264b16 100644 --- a/src/engine/network_engine/clientenginefactory.cpp +++ b/src/engine/network_engine/clientenginefactory.cpp @@ -25,6 +25,8 @@ #include "clientflop.h" #include "clientturn.h" #include "clientriver.h" +#include "clientbero.h" + ClientEngineFactory::ClientEngineFactory() @@ -72,3 +74,7 @@ RiverInterface* ClientEngineFactory::createRiver(HandInterface* hi, int id, int return new ClientRiver(hi, id, aP, dP, sB); } +BeRoInterface* ClientEngineFactory::createBeRo() +{ + return new ClientBeRo(); +} diff --git a/src/engine/network_engine/clientenginefactory.h b/src/engine/network_engine/clientenginefactory.h index 95b0867a..e740d942 100644 --- a/src/engine/network_engine/clientenginefactory.h +++ b/src/engine/network_engine/clientenginefactory.h @@ -28,6 +28,8 @@ #include #include #include +#include + class ConfigFile; @@ -44,6 +46,8 @@ 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(); + }; #endif