BeRo refactoring
This commit is contained in:
@@ -1,49 +0,0 @@
|
||||
//
|
||||
// C++ Implementation: clientberofactory
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
//
|
||||
// Author: FThauer FHammer <webmaster@pokerth.net>, (C) 2007
|
||||
//
|
||||
// Copyright: See COPYING file that comes with this distribution
|
||||
//
|
||||
//
|
||||
#include "clientberofactory.h"
|
||||
#include <clientpreflop.h>
|
||||
#include <clientflop.h>
|
||||
#include <clientturn.h>
|
||||
#include <clientriver.h>
|
||||
|
||||
ClientBeRoFactory::ClientBeRoFactory(HandInterface* hi, int id, int aP, int dP, int sB)
|
||||
: myHand(hi), myID(id), actualQuantityPlayers(aP), dealerPosition(dP), smallBlind(sB)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
ClientBeRoFactory::~ClientBeRoFactory()
|
||||
{
|
||||
}
|
||||
|
||||
std::vector<boost::shared_ptr<BeRoInterface> > ClientBeRoFactory::createBeRo()
|
||||
{
|
||||
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
|
||||
|
||||
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRoPreflop(myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind)));
|
||||
|
||||
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRoFlop(myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind)));
|
||||
|
||||
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRoTurn(myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind)));
|
||||
|
||||
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRoRiver(myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind)));
|
||||
|
||||
// myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRoPostRiver(myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind)));
|
||||
|
||||
return myBeRo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
BeRoInterface* ClientBeRoFactory::switchRounds(BeRoInterface* currentBeRo, int currentRound) { return NULL;}
|
||||
|
||||
BeRoInterface* ClientBeRoFactory::createBeRoPreflop() { return NULL; }
|
||||
@@ -1,48 +0,0 @@
|
||||
//
|
||||
// C++ Interface: clientberofactory
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
//
|
||||
// Author: FThauer FHammer <webmaster@pokerth.net>, (C) 2007
|
||||
//
|
||||
// Copyright: See COPYING file that comes with this distribution
|
||||
//
|
||||
//
|
||||
#ifndef CLIENTBEROFACTORY_H
|
||||
#define CLIENTBEROFACTORY_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include <berofactoryinterface.h>
|
||||
#include <handinterface.h>
|
||||
|
||||
/**
|
||||
@author FThauer FHammer <webmaster@pokerth.net>
|
||||
*/
|
||||
class ClientBeRoFactory : public BeRoFactoryInterface
|
||||
{
|
||||
public:
|
||||
ClientBeRoFactory(HandInterface* hi, int id, int aP, int dP, int sB);
|
||||
|
||||
~ClientBeRoFactory();
|
||||
|
||||
BeRoInterface* switchRounds(BeRoInterface*, int);
|
||||
|
||||
BeRoInterface* createBeRoPreflop();
|
||||
|
||||
std::vector<boost::shared_ptr<BeRoInterface> > createBeRo();
|
||||
|
||||
private:
|
||||
|
||||
HandInterface* myHand;
|
||||
|
||||
int myID;
|
||||
int actualQuantityPlayers;
|
||||
int dealerPosition;
|
||||
int smallBlind;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "clientflop.h"
|
||||
#include "clientturn.h"
|
||||
#include "clientriver.h"
|
||||
#include "clientberofactory.h"
|
||||
|
||||
|
||||
|
||||
@@ -54,31 +53,6 @@ PlayerInterface* ClientEngineFactory::createPlayer(BoardInterface *b, int id, un
|
||||
return new ClientPlayer(NULL, b, id, uniqueId, type, name, avatar, sC, aS, mB);
|
||||
}
|
||||
|
||||
PreflopInterface* ClientEngineFactory::createPreflop(HandInterface* hi, int id, int aP, int dP, int sB)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
FlopInterface* ClientEngineFactory::createFlop(HandInterface* hi, int id, int aP, int dP, int sB)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
TurnInterface* ClientEngineFactory::createTurn(HandInterface* hi, int id, int aP, int dP, int sB)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
RiverInterface* ClientEngineFactory::createRiver(HandInterface* hi, int id, int aP, int dP, int sB)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
BeRoFactoryInterface* ClientEngineFactory::createBeRoFactory(HandInterface* hi, int id, int aP, int dP, int sB)
|
||||
{
|
||||
return new ClientBeRoFactory(hi, id, aP, dP, sB);
|
||||
}
|
||||
|
||||
std::vector<boost::shared_ptr<BeRoInterface> > ClientEngineFactory::createBeRo(HandInterface* hi, int id, int aP, int dP, int sB) {
|
||||
|
||||
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
|
||||
|
||||
@@ -24,12 +24,6 @@
|
||||
#include <handinterface.h>
|
||||
#include <boardinterface.h>
|
||||
#include <playerinterface.h>
|
||||
#include <preflopinterface.h>
|
||||
#include <flopinterface.h>
|
||||
#include <turninterface.h>
|
||||
#include <riverinterface.h>
|
||||
// #include <berofactoryinterface.h>
|
||||
|
||||
|
||||
class ConfigFile;
|
||||
|
||||
@@ -42,11 +36,6 @@ public:
|
||||
HandInterface* createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, PlayerInterface **p, int id, int sP, int aP, int dP, int sB,int sC);
|
||||
BoardInterface* createBoard();
|
||||
PlayerInterface* createPlayer(BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB);
|
||||
PreflopInterface* createPreflop(HandInterface* hi, int id, int aP, int dP, int sB);
|
||||
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);
|
||||
BeRoFactoryInterface* createBeRoFactory(HandInterface* hi, int id, int aP, int dP, int sB);
|
||||
std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface* hi, int id, int aP, int dP, int sB);
|
||||
|
||||
};
|
||||
|
||||
@@ -55,7 +55,7 @@ ClientHand::ClientHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, Boar
|
||||
// the rest of the buttons are assigned later as received from the server.
|
||||
|
||||
// Preflop, Flop, Turn und River erstellen
|
||||
myBeRo = myFactory->createBeRoFactory(this, myID, actualQuantityPlayers, dealerPosition, smallBlind)->createBeRo();
|
||||
myBeRo = myFactory->createBeRo(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user