2007-08-04 12:08:10 +00:00
|
|
|
//
|
|
|
|
|
// C++ Implementation: localberofactory
|
|
|
|
|
//
|
2007-08-04 21:30:20 +00:00
|
|
|
// Description:
|
2007-08-04 12:08:10 +00:00
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// Author: FThauer FHammer <webmaster@pokerth.net>, (C) 2007
|
|
|
|
|
//
|
|
|
|
|
// Copyright: See COPYING file that comes with this distribution
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
#include "localberofactory.h"
|
|
|
|
|
|
2007-08-06 21:38:09 +00:00
|
|
|
#include <localberopreflop.h>
|
|
|
|
|
#include <localberoflop.h>
|
|
|
|
|
#include <localberoturn.h>
|
|
|
|
|
#include <localberoriver.h>
|
|
|
|
|
#include <localberopostriver.h>
|
|
|
|
|
|
2007-08-05 13:07:23 +00:00
|
|
|
using namespace std;
|
|
|
|
|
|
2007-08-04 22:05:12 +00:00
|
|
|
LocalBeRoFactory::LocalBeRoFactory (HandInterface* hi, int id, int aP, int dP, int sB)
|
|
|
|
|
: BeRoFactoryInterface() , myHand(hi), myID(id), actualQuantityPlayers(aP), dealerPosition(dP), smallBlind(sB)
|
2007-08-04 21:30:20 +00:00
|
|
|
{}
|
2007-08-04 12:08:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
LocalBeRoFactory::~LocalBeRoFactory()
|
2007-08-04 21:30:20 +00:00
|
|
|
{}
|
|
|
|
|
|
2007-08-06 20:35:26 +00:00
|
|
|
std::vector<boost::shared_ptr<BeRoInterface> > LocalBeRoFactory::createBeRo() {
|
|
|
|
|
|
|
|
|
|
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
|
|
|
|
|
|
|
|
|
|
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoPreflop(myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind)));
|
|
|
|
|
|
|
|
|
|
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoFlop(myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind)));
|
|
|
|
|
|
|
|
|
|
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoTurn(myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind)));
|
|
|
|
|
|
|
|
|
|
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoRiver(myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind)));
|
|
|
|
|
|
|
|
|
|
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoPostRiver(myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind)));
|
|
|
|
|
|
|
|
|
|
return myBeRo;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2007-08-05 23:57:16 +00:00
|
|
|
BeRoInterface* LocalBeRoFactory::createBeRoPreflop() {
|
|
|
|
|
|
|
|
|
|
BeRoInterface* preflopBeRo = new LocalBeRoPreflop ( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
|
|
|
|
|
|
|
|
|
|
return preflopBeRo;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BeRoInterface* LocalBeRoFactory::switchRounds(BeRoInterface* currentBeRo, int currentRound)
|
2007-08-04 12:08:10 +00:00
|
|
|
{
|
2007-08-05 23:57:16 +00:00
|
|
|
if(currentRound != currentBeRo->getMyBeRoID()) {
|
2007-08-04 21:30:20 +00:00
|
|
|
|
2007-08-05 23:57:16 +00:00
|
|
|
delete currentBeRo;
|
|
|
|
|
currentBeRo = NULL;
|
2007-08-04 21:30:20 +00:00
|
|
|
|
2007-08-05 23:57:16 +00:00
|
|
|
switch(currentRound) {
|
|
|
|
|
case GAME_STATE_PREFLOP: {
|
2007-08-05 13:07:23 +00:00
|
|
|
|
2007-08-05 23:57:16 +00:00
|
|
|
currentBeRo = new LocalBeRoPreflop ( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
|
2007-08-05 13:07:23 +00:00
|
|
|
}
|
2007-08-05 23:57:16 +00:00
|
|
|
break;
|
|
|
|
|
case GAME_STATE_FLOP: {
|
|
|
|
|
|
|
|
|
|
currentBeRo = new LocalBeRoFlop( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
|
2007-08-05 13:07:23 +00:00
|
|
|
}
|
2007-08-05 23:57:16 +00:00
|
|
|
break;
|
|
|
|
|
case GAME_STATE_TURN: {
|
|
|
|
|
|
|
|
|
|
currentBeRo = new LocalBeRoTurn( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
|
2007-08-05 13:07:23 +00:00
|
|
|
|
|
|
|
|
}
|
2007-08-05 23:57:16 +00:00
|
|
|
break;
|
|
|
|
|
case GAME_STATE_RIVER: {
|
|
|
|
|
|
|
|
|
|
currentBeRo = new LocalBeRoRiver ( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
|
2007-08-05 13:07:23 +00:00
|
|
|
|
|
|
|
|
}
|
2007-08-05 23:57:16 +00:00
|
|
|
break;
|
|
|
|
|
case GAME_STATE_POST_RIVER: {
|
|
|
|
|
|
|
|
|
|
currentBeRo = new LocalBeRoPostRiver ( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
|
2007-08-05 13:07:23 +00:00
|
|
|
|
|
|
|
|
}
|
2007-08-05 23:57:16 +00:00
|
|
|
break;
|
|
|
|
|
default: { cout << "BeRoFactory-ERROR" << endl; }
|
2007-08-05 13:07:23 +00:00
|
|
|
}
|
2007-08-05 23:57:16 +00:00
|
|
|
|
2007-08-05 13:07:23 +00:00
|
|
|
}
|
|
|
|
|
|
2007-08-05 23:57:16 +00:00
|
|
|
return currentBeRo;
|
2007-08-04 12:08:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-04 21:30:20 +00:00
|
|
|
|