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-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-05 13:07:23 +00:00
|
|
|
BeRoInterface* LocalBeRoFactory::switchRounds(int currentRound)
|
2007-08-04 12:08:10 +00:00
|
|
|
{
|
2007-08-04 21:30:20 +00:00
|
|
|
|
2007-08-04 22:19:40 +00:00
|
|
|
BeRoInterface* myBeRo = NULL;
|
2007-08-04 21:30:20 +00:00
|
|
|
|
2007-08-05 13:07:23 +00:00
|
|
|
switch(currentRound) {
|
|
|
|
|
case GAME_STATE_PREFLOP: {
|
|
|
|
|
if(currentRound != myHand->getCurrentBeRo()->getMyBeRoID()) {
|
|
|
|
|
|
|
|
|
|
delete myBeRo;
|
|
|
|
|
myBeRo = NULL;
|
|
|
|
|
|
|
|
|
|
myBeRo = new LocalBeRoPreflop ( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case GAME_STATE_FLOP: {
|
|
|
|
|
if(currentRound != myHand->getCurrentBeRo()->getMyBeRoID()) {
|
|
|
|
|
|
|
|
|
|
delete myBeRo;
|
|
|
|
|
myBeRo = NULL;
|
|
|
|
|
|
|
|
|
|
myBeRo = new LocalBeRoFlop( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case GAME_STATE_TURN: {
|
|
|
|
|
if(currentRound != myHand->getCurrentBeRo()->getMyBeRoID()) {
|
|
|
|
|
|
|
|
|
|
delete myBeRo;
|
|
|
|
|
myBeRo = NULL;
|
|
|
|
|
|
|
|
|
|
myBeRo = new LocalBeRoTurn( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case GAME_STATE_RIVER: {
|
|
|
|
|
if(currentRound != myHand->getCurrentBeRo()->getMyBeRoID()) {
|
|
|
|
|
|
|
|
|
|
delete myBeRo;
|
|
|
|
|
myBeRo = NULL;
|
|
|
|
|
|
|
|
|
|
myBeRo = new LocalBeRoRiver ( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case GAME_STATE_POST_RIVER: {
|
|
|
|
|
if(currentRound != myHand->getCurrentBeRo()->getMyBeRoID()) {
|
|
|
|
|
|
|
|
|
|
delete myBeRo;
|
|
|
|
|
myBeRo = NULL;
|
|
|
|
|
|
|
|
|
|
myBeRo = new LocalBeRoPostRiver ( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default: { cout << "BeRoFactory-ERROR" << endl; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-08-04 21:30:20 +00:00
|
|
|
|
|
|
|
|
return myBeRo;
|
2007-08-04 12:08:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-04 21:30:20 +00:00
|
|
|
|