more polymorphie steps for BeRo

This commit is contained in:
doitux
2007-08-05 13:07:23 +00:00
parent ce61172ab3
commit b68b8d48dd
29 changed files with 1736 additions and 41 deletions
+60 -2
View File
@@ -11,6 +11,8 @@
//
#include "localberofactory.h"
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)
{}
@@ -19,12 +21,68 @@ LocalBeRoFactory::LocalBeRoFactory (HandInterface* hi, int id, int aP, int dP, i
LocalBeRoFactory::~LocalBeRoFactory()
{}
BeRoInterface* LocalBeRoFactory::switchRounds()
BeRoInterface* LocalBeRoFactory::switchRounds(int currentRound)
{
BeRoInterface* myBeRo = NULL;
myBeRo = new LocalBeRoPreflop ( myHand, myID, actualQuantityPlayers, dealerPosition, smallBlind );
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;
}