This commit is contained in:
doitux
2007-01-14 12:15:45 +00:00
parent 31c4c0dde9
commit 514eb3c958
21 changed files with 141 additions and 81 deletions
+11 -7
View File
@@ -28,13 +28,13 @@
#include "turninterface.h"
#include "riverinterface.h"
class HandInterface;
class BoardInterface;
class PlayerInterface;
class PreflopInterface;
class FlopInterface;
class TurnInterface;
class RiverInterface;
// class HandInterface;
// class BoardInterface;
// class PlayerInterface;
// class PreflopInterface;
// class FlopInterface;
// class TurnInterface;
// class RiverInterface;
class EngineFactory{
public:
@@ -44,6 +44,10 @@ public:
virtual HandInterface* createHand(GuiInterface *g, BoardInterface *b, PlayerInterface **p, int id, int qP, int dP, int sB,int sC) =0;
virtual BoardInterface* createBoard() =0;
virtual PlayerInterface* createPlayer(BoardInterface *b, int id, int sC, bool aS, int mB) =0;
virtual PreflopInterface* createPreflop(HandInterface* hi, int id, int qP, int dP, int sB) =0;
virtual FlopInterface* createFlop(HandInterface* hi, int id, int qP, int dP, int sB) =0;
virtual TurnInterface* createTurn(HandInterface* hi, int id, int qP, int dP, int sB) =0;
virtual RiverInterface* createRiver(HandInterface* hi, int id, int qP, int dP, int sB) =0;
};
-5
View File
@@ -19,11 +19,6 @@
***************************************************************************/
#include "flopinterface.h"
FlopInterface::FlopInterface()
{
}
FlopInterface::~FlopInterface()
{
}
+20 -5
View File
@@ -20,14 +20,29 @@
#ifndef FLOPINTERFACE_H
#define FLOPINTERFACE_H
/**
@author FThauer FHammer <f.thauer@web.de>
*/
class FlopInterface{
public:
FlopInterface();
~FlopInterface();
virtual ~FlopInterface();
virtual void setPlayersTurn(const int& theValue) =0;
virtual int getPlayersTurn() const =0;
virtual void setHighestSet(const int& theValue) =0;
virtual int getHighestSet() const =0;
virtual void setFirstFlopRound(bool theValue) =0;
virtual bool getFirstFlopRound() const =0;
virtual void setSmallBlindPosition(const int& theValue) =0;
virtual int getSmallBlindPosition() const =0;
virtual void setSmallBlind(const int& theValue) =0;
virtual int getSmallBlind() const =0;
virtual void flopRun() =0;
virtual void nextPlayer2() =0;
};
+8 -4
View File
@@ -21,6 +21,10 @@
#define HANDINTERFACE_H
#include "guiinterface.h"
#include "preflopinterface.h"
#include "flopinterface.h"
#include "turninterface.h"
#include "riverinterface.h"
class HandInterface{
public:
@@ -29,10 +33,10 @@ public:
virtual PlayerInterface** getPlayerArray() const =0;
virtual BoardInterface* getBoard() const =0;
// virtual LocalPreflop* getPreflop() const =0;
// virtual LocalFlop* getFlop() const =0;
// virtual LocalTurn* getTurn() const =0;
// virtual LocalRiver* getRiver() const =0;
virtual PreflopInterface* getPreflop() const =0;
virtual FlopInterface* getFlop() const =0;
virtual TurnInterface* getTurn() const =0;
virtual RiverInterface* getRiver() const =0;
virtual GuiInterface* getGuiInterface() const =0;
virtual void setMyID(const int& theValue) =0;
@@ -44,10 +44,10 @@ BoardInterface* LocalEngineFactory::createBoard() { return new LocalBoard; }
PlayerInterface* LocalEngineFactory::createPlayer(BoardInterface *b, int id, int sC, bool aS, int mB) { return new LocalPlayer(b, id, sC, aS, mB); }
PreflopInterface* LocalEngineFactory::createPreflop() {/* return new LocalPreflop;*/ }
PreflopInterface* LocalEngineFactory::createPreflop(HandInterface* hi, int id, int qP, int dP, int sB) { return new LocalPreflop(hi, id, qP, dP, sB); }
FlopInterface* LocalEngineFactory::createFlop() { /*return new LocalFlop;*/ }
FlopInterface* LocalEngineFactory::createFlop(HandInterface* hi, int id, int qP, int dP, int sB) { return new LocalFlop(hi, id, qP, dP, sB); }
TurnInterface* LocalEngineFactory::createTurn() { /*return new LocalTurn;*/ }
TurnInterface* LocalEngineFactory::createTurn(HandInterface* hi, int id, int qP, int dP, int sB) { return new LocalTurn(hi, id, qP, dP, sB); }
RiverInterface* LocalEngineFactory::createRiver() { /*return new LocalRiver;*/ }
RiverInterface* LocalEngineFactory::createRiver(HandInterface* hi, int id, int qP, int dP, int sB) { return new LocalRiver(hi, id, qP, dP, sB); }
+4 -4
View File
@@ -33,10 +33,10 @@ public:
HandInterface* createHand(GuiInterface *g, BoardInterface *b, PlayerInterface **p, int id, int qP, int dP, int sB,int sC);
BoardInterface* createBoard();
PlayerInterface* createPlayer(BoardInterface *b, int id, int sC, bool aS, int mB);
PreflopInterface* createPreflop();
FlopInterface* createFlop();
TurnInterface* createTurn();
RiverInterface* createRiver();
PreflopInterface* createPreflop(HandInterface* hi, int id, int qP, int dP, int sB);
FlopInterface* createFlop(HandInterface* hi, int id, int qP, int dP, int sB);
TurnInterface* createTurn(HandInterface* hi, int id, int qP, int dP, int sB);
RiverInterface* createRiver(HandInterface* hi, int id, int qP, int dP, int sB);
};
#endif
+1 -2
View File
@@ -18,11 +18,10 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "localflop.h"
#include "localhand.h"
using namespace std;
LocalFlop::LocalFlop(LocalHand* bR, int id, int qP, int dP, int sB) : myHand(bR), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstFlopRun(1), firstFlopRound(1), playersTurn(dP)
LocalFlop::LocalFlop(HandInterface* bR, int id, int qP, int dP, int sB) : FlopInterface(), myHand(bR), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstFlopRun(1), firstFlopRound(1), playersTurn(dP)
{
int i;
+6 -5
View File
@@ -20,14 +20,15 @@
#ifndef LOCALFLOP_H
#define LOCALFLOP_H
#include "flopinterface.h"
#include "handinterface.h"
#include <iostream>
class LocalHand;
class LocalFlop {
class LocalFlop : public FlopInterface{
public:
LocalFlop(LocalHand*, int, int, int, int);
LocalFlop(HandInterface*, int, int, int, int);
~LocalFlop();
@@ -52,7 +53,7 @@ public:
private:
LocalHand *myHand;
HandInterface *myHand;
int myID;
int actualQuantityPlayers;
+4 -3
View File
@@ -17,14 +17,15 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef LOCALHAND_H
#define LOCALHAND_H
#ifndef HandInterface_H
#define HandInterface_H
#include "guiinterface.h"
#include "handinterface.h"
#include "tools.h"
#include "cardsvalue.h"
#include "localpreflop.h"
#include "localflop.h"
#include "localturn.h"
@@ -50,7 +51,7 @@ public:
PlayerInterface** getPlayerArray() const { return playerArray; }
PlayerInterface** getPlayerArray() const { return playerArray; }
BoardInterface* getBoard() const { return myBoard; }
LocalPreflop* getPreflop() const { return myPreflop; }
LocalFlop* getFlop() const { return myFlop; }
+3 -3
View File
@@ -29,7 +29,7 @@
class CardsValue;
class LocalHand;
class HandInterface;
class BoardInterface;
class LocalPlayer : public PlayerInterface{
@@ -38,7 +38,7 @@ public:
~LocalPlayer();
void setHand(LocalHand*);
void setHand(HandInterface*);
void setMyID(const int& theValue) { myID = theValue; }
int getMyID() const { return myID; }
@@ -92,7 +92,7 @@ public:
private:
LocalHand *actualHand;
HandInterface *actualHand;
BoardInterface *actualBoard;
CardsValue *myCardsValue;
+3 -2
View File
@@ -18,11 +18,12 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "localpreflop.h"
#include "localhand.h"
#include "handinterface.h"
using namespace std;
LocalPreflop::LocalPreflop(LocalHand* bR, int id, int qP, int dP, int sB) : myHand(bR), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), bigBlindPosition(0), smallBlind(sB), highestSet(2*sB), preflopFirstRound(1), playersTurn(0)
LocalPreflop::LocalPreflop(HandInterface* bR, int id, int qP, int dP, int sB) : PreflopInterface(), myHand(bR), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), bigBlindPosition(0), smallBlind(sB), highestSet(2*sB), preflopFirstRound(1), playersTurn(0)
{
+6 -4
View File
@@ -20,14 +20,16 @@
#ifndef LOCALPREFLOP_H
#define LOCALPREFLOP_H
#include "preflopinterface.h"
#include <iostream>
class LocalHand;
class HandInterface;
class LocalPreflop {
class LocalPreflop : public PreflopInterface{
public:
LocalPreflop(LocalHand*, int, int, int, int);
LocalPreflop(HandInterface*, int, int, int, int);
~LocalPreflop();
@@ -46,7 +48,7 @@ public:
private:
LocalHand *myHand;
HandInterface *myHand;
int myID;
int actualQuantityPlayers;
+1 -2
View File
@@ -19,11 +19,10 @@
***************************************************************************/
#include "localriver.h"
#include "localhand.h"
using namespace std;
LocalRiver::LocalRiver(LocalHand* bR, int id, int qP, int dP, int sB) : myHand(bR), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstRiverRun(1), firstRiverRound(1), playersTurn(dP), highestCardsValue(0)
LocalRiver::LocalRiver(HandInterface* bR, int id, int qP, int dP, int sB) : RiverInterface(), myHand(bR), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstRiverRun(1), firstRiverRound(1), playersTurn(dP), highestCardsValue(0)
{ int i;
+6 -4
View File
@@ -20,14 +20,16 @@
#ifndef LOCALRIVER_H
#define LOCALRIVER_H
#include "riverinterface.h"
#include <iostream>
class LocalHand;
#include "handinterface.h"
class LocalRiver {
class LocalRiver : public RiverInterface{
public:
LocalRiver(LocalHand*, int, int, int, int);
LocalRiver(HandInterface*, int, int, int, int);
~LocalRiver();
@@ -56,7 +58,7 @@ public:
private:
LocalHand *myHand;
HandInterface *myHand;
int myID;
int actualQuantityPlayers;
+2 -2
View File
@@ -18,11 +18,11 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "localturn.h"
#include "localhand.h"
using namespace std;
LocalTurn::LocalTurn(LocalHand* bR, int id, int qP, int dP, int sB) : myHand(bR), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstTurnRun(1), firstTurnRound(1), playersTurn(dP)
LocalTurn::LocalTurn(HandInterface* bR, int id, int qP, int dP, int sB) : TurnInterface(), myHand(bR), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstTurnRun(1), firstTurnRound(1), playersTurn(dP)
{ int i;
+7 -5
View File
@@ -20,14 +20,16 @@
#ifndef LOCALTURN_H
#define LOCALTURN_H
#include "turninterface.h"
#include "handinterface.h"
#include <iostream>
class LocalHand;
class LocalTurn {
class LocalTurn : public TurnInterface{
public:
LocalTurn(LocalHand*, int, int, int, int);
LocalTurn(HandInterface*, int, int, int, int);
~LocalTurn();
@@ -51,7 +53,7 @@ public:
private:
LocalHand *myHand;
HandInterface *myHand;
int myID;
int actualQuantityPlayers;
+12
View File
@@ -25,6 +25,18 @@ public:
virtual ~PreflopInterface();
virtual void setPlayersTurn(const int& theValue) =0;
virtual int getPlayersTurn() const =0;
virtual void setHighestSet(const int& theValue) =0;
virtual int getHighestSet() const =0;
virtual void setLocalPreflopFirstRound(bool theValue) =0;
virtual bool setLocalPreflopFirstRound() const =0;
virtual void preflopRun() =0;
virtual void nextPlayer2() =0;
};
-5
View File
@@ -19,11 +19,6 @@
***************************************************************************/
#include "riverinterface.h"
RiverInterface::RiverInterface()
{
}
RiverInterface::~RiverInterface()
{
}
+24 -5
View File
@@ -20,14 +20,33 @@
#ifndef RIVERINTERFACE_H
#define RIVERINTERFACE_H
/**
@author FThauer FHammer <f.thauer@web.de>
*/
class RiverInterface{
public:
RiverInterface();
~RiverInterface();
virtual ~RiverInterface();
virtual void setPlayersTurn(const int& theValue) =0;
virtual int getPlayersTurn() const =0;
virtual void setHighestSet(const int& theValue) =0;
virtual int getHighestSet() const =0;
virtual void setFirstRiverRound(bool theValue) =0;
virtual bool getFirstRiverRound() const =0;
virtual void setSmallBlindPosition(const int& theValue) =0;
virtual int getSmallBlindPosition() const =0;
virtual void setSmallBlind(const int& theValue) =0;
virtual int getSmallBlind() const =0;
virtual void setHighestCardsValue(const int& theValue) =0;
virtual int getHighestCardsValue() const =0;
virtual void riverRun() =0;
virtual void postRiverRun() =0;
virtual void nextPlayer2() =0;
virtual void distributePot() =0;
};
-5
View File
@@ -19,11 +19,6 @@
***************************************************************************/
#include "turninterface.h"
TurnInterface::TurnInterface()
{
}
TurnInterface::~TurnInterface()
{
}
+19 -5
View File
@@ -20,14 +20,28 @@
#ifndef TURNINTERFACE_H
#define TURNINTERFACE_H
/**
@author FThauer FHammer <f.thauer@web.de>
*/
class TurnInterface{
public:
TurnInterface();
virtual ~TurnInterface();
~TurnInterface();
virtual void setPlayersTurn(const int& theValue) =0;
virtual int getPlayersTurn() const =0;
virtual void setHighestSet(const int& theValue) =0;
virtual int getHighestSet() const=0;
virtual void setFirstTurnRound(bool theValue) =0;
virtual bool getFirstTurnRound() const =0;
virtual void setSmallBlindPosition(const int& theValue) =0;
virtual int getSmallBlindPosition() const =0;
virtual void setSmallBlind(const int& theValue) =0;
virtual int getSmallBlind() const =0;
virtual void turnRun() =0;
virtual void nextPlayer2() =0;
};