more polymorphie steps for BeRo - local game --> unstable
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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); }
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user