Files
pokerth/src/engine/local_engine/localberofactory.cpp
T

92 lines
1.9 KiB
C++
Raw Normal View History

2007-08-04 12:08:10 +00:00
//
// C++ Implementation: localberofactory
//
// 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;
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 12:08:10 +00:00
LocalBeRoFactory::~LocalBeRoFactory()
{}
2007-08-05 13:07:23 +00:00
BeRoInterface* LocalBeRoFactory::switchRounds(int currentRound)
2007-08-04 12:08:10 +00:00
{
2007-08-04 22:19:40 +00:00
BeRoInterface* myBeRo = NULL;
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; }
}
return myBeRo;
2007-08-04 12:08:10 +00:00
}