more polymorphie steps for BeRo - local game --> unstable

This commit is contained in:
doitux
2007-08-04 21:30:20 +00:00
parent 1f00b3f458
commit 07f8a2aaeb
19 changed files with 87 additions and 45 deletions
+14 -5
View File
@@ -1,7 +1,7 @@
//
// C++ Implementation: localberofactory
//
// Description:
// Description:
//
//
// Author: FThauer FHammer <webmaster@pokerth.net>, (C) 2007
@@ -11,14 +11,23 @@
//
#include "localberofactory.h"
LocalBeRoFactory::LocalBeRoFactory()
: BeRoFactoryInterface()
{
}
LocalBeRoFactory::LocalBeRoFactory ( HandInterface* hi )
: BeRoFactoryInterface() , myHand ( hi )
{}
LocalBeRoFactory::~LocalBeRoFactory()
{}
BeRoInterface* LocalBeRoFactory::switchRounds()
{
BeRoInterface* myBeRo = 0;
myBeRo = new LocalBeRoPreflop ( myHand, 0, 7, 0, 10 );
return myBeRo;
}
+10 -1
View File
@@ -13,6 +13,9 @@
#define LOCALBEROFACTORY_H
#include <berofactoryinterface.h>
#include <berointerface.h>
#include <handinterface.h>
#include <localberopreflop.h>
/**
@author FThauer FHammer <webmaster@pokerth.net>
@@ -20,10 +23,16 @@
class LocalBeRoFactory : public BeRoFactoryInterface
{
public:
LocalBeRoFactory();
LocalBeRoFactory(HandInterface* hi);
~LocalBeRoFactory();
BeRoInterface* switchRounds();
private:
HandInterface* myHand;
};
#endif
@@ -57,7 +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(); }
// BeRoInterface* LocalEngineFactory::createBeRo() { return new LocalBeRo(); }
BeRoFactoryInterface* LocalEngineFactory::createBeRoFactory() { return new LocalBeRoFactory(); }
BeRoFactoryInterface* LocalEngineFactory::createBeRoFactory(HandInterface* hi) { return new LocalBeRoFactory(hi); }
+3 -3
View File
@@ -29,7 +29,7 @@
#include <flopinterface.h>
#include <turninterface.h>
#include <riverinterface.h>
#include <berointerface.h>
// #include <berointerface.h>
#include <berofactoryinterface.h>
class ConfigFile;
@@ -47,8 +47,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();
BeRoFactoryInterface* createBeRoFactory();
// BeRoInterface* createBeRo();
BeRoFactoryInterface* createBeRoFactory(HandInterface* hi);
private:
ConfigFile *myConfig;
+3 -2
View File
@@ -172,7 +172,8 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
myTurn = myFactory->createTurn(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
myRiver = myFactory->createRiver(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
myBeRo = myFactory->createBeRo();
myBeRoFactory = myFactory->createBeRoFactory(this);
myBeRo = myBeRoFactory->switchRounds();
}
@@ -324,7 +325,7 @@ void LocalHand::switchRounds() {
if(playerArray[i]->getMyAction() != 1 && playerArray[i]->getMyAction() != 6 && playerArray[i]->getMyActiveStatus() == 1) {
tempHighestSet = 0;
switch (actualRound) {
case 0: {tempHighestSet = myPreflop->getHighestSet();}
case 0: {tempHighestSet = myBeRo->getHighestSet();}
break;
case 1: {tempHighestSet = myFlop->getHighestSet();}
break;
+3 -1
View File
@@ -30,6 +30,7 @@
#include <turninterface.h>
#include <riverinterface.h>
#include <berointerface.h>
#include <berofactoryinterface.h>
class LocalHand : public HandInterface{
@@ -41,7 +42,7 @@ public:
PlayerInterface** getPlayerArray() const { return playerArray; }
BoardInterface* getBoard() const { return myBoard; }
PreflopInterface* getPreflop() const { return myPreflop; }
BeRoInterface* getPreflop() const { return myBeRo; }
FlopInterface* getFlop() const { return myFlop; }
TurnInterface* getTurn() const { return myTurn; }
RiverInterface* getRiver() const { return myRiver; }
@@ -99,6 +100,7 @@ private:
TurnInterface *myTurn;
RiverInterface *myRiver;
BeRoInterface *myBeRo;
BeRoFactoryInterface *myBeRoFactory;
int myID;
int actualQuantityPlayers;