This commit is contained in:
doitux
2007-01-13 22:29:17 +00:00
parent ccd74ccb92
commit 507ffdd2a8
21 changed files with 176 additions and 85 deletions
+2 -2
View File
@@ -23,7 +23,7 @@
using namespace std;
LocalBoard::LocalBoard() : playerArray(0), actualHand(0), pot(0), sets(0)
LocalBoard::LocalBoard() : BoardInterface(), playerArray(0), actualHand(0), pot(0), sets(0)
{
}
@@ -32,7 +32,7 @@ LocalBoard::~LocalBoard()
{
}
void LocalBoard::setPlayer(LocalPlayer** p) { playerArray = p; }
void LocalBoard::setPlayer(PlayerInterface** p) { playerArray = p; }
void LocalBoard::setHand(LocalHand* br) { actualHand = br; }
+9 -7
View File
@@ -20,20 +20,22 @@
#ifndef LOCALBOARD_H
#define LOCALBOARD_H
#include "boardinterface.h"
#include <iostream>
class LocalPlayer;
class LocalHand;
class PlayerInterface;
class HandInterface;
class LocalBoard{
class LocalBoard : public BoardInterface{
public:
LocalBoard();
~LocalBoard();
void setPlayer(LocalPlayer**);
void setHand(LocalHand*);
void setPlayer(PlayerInterface**);
void setHand(HandInterface*);
void setMyCards(int* theValue) { int i; for(i=0; i<5; i++) myCards[i] = theValue[i]; }
void getMyCards(int* theValue) { int i; for(i=0; i<5; i++) theValue[i] = myCards[i]; }
@@ -47,8 +49,8 @@ public:
private:
LocalPlayer **playerArray;
LocalHand *actualHand;
PlayerInterface **playerArray;
HandInterface *actualHand;
int myCards[5];
int pot;
@@ -38,11 +38,11 @@ LocalEngineFactory::~LocalEngineFactory()
}
HandInterface* LocalEngineFactory::createHand() { /*return new LocalHand;*/ }
HandInterface* LocalEngineFactory::createHand(GuiInterface *g, BoardInterface *b, PlayerInterface **p, int id, int qP, int dP, int sB,int sC) { return new LocalHand(g, b, p, id, qP, dP, sB, sC); }
BoardInterface* LocalEngineFactory::createBoard() { return new LocalBoard; }
PlayerInterface* LocalEngineFactory::createPlayer() { /*return new LocalPlayer;*/ }
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;*/ }
+2 -3
View File
@@ -22,7 +22,6 @@
#include <enginefactory.h>
class BoardInterface;
class LocalEngineFactory : public EngineFactory
{
@@ -31,9 +30,9 @@ public:
~LocalEngineFactory();
HandInterface* createHand();
HandInterface* createHand(GuiInterface *g, BoardInterface *b, PlayerInterface **p, int id, int qP, int dP, int sB,int sC);
BoardInterface* createBoard();
PlayerInterface* createPlayer();
PlayerInterface* createPlayer(BoardInterface *b, int id, int sC, bool aS, int mB);
PreflopInterface* createPreflop();
FlopInterface* createFlop();
TurnInterface* createTurn();
+1 -1
View File
@@ -21,7 +21,7 @@
using namespace std;
LocalHand::LocalHand(GuiInterface *g, LocalBoard *b, LocalPlayer **p, int id, int qP, int dP, int sB,int sC) : myGui(g), myBoard(b), playerArray(p), myPreflop(0), myFlop(0), myTurn(0), myRiver(0), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), actualRound(0), smallBlind(sB), startCash(sC), allInCondition(0)
LocalHand::LocalHand(GuiInterface *g, BoardInterface *b, PlayerInterface **p, int id, int qP, int dP, int sB,int sC) : HandInterface(), myGui(g), myBoard(b), playerArray(p), myPreflop(0), myFlop(0), myTurn(0), myRiver(0), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), actualRound(0), smallBlind(sB), startCash(sC), allInCondition(0)
{
int i, j;
CardsValue myCardsValue;
+21 -12
View File
@@ -20,10 +20,10 @@
#ifndef LOCALHAND_H
#define LOCALHAND_H
#include "guiinterface.h"
#include "localboard.h"
#include "localplayer.h"
#include "handinterface.h"
#include "tools.h"
#include "localpreflop.h"
#include "localflop.h"
@@ -32,23 +32,26 @@
class GuiInterface;
class LocalBoard;
class LocalPlayer;
class BoardInterface;
class PlayerInterface;
class HandInterface;
class LocalPreflop;
class LocalFlop;
class LocalTurn;
class LocalRiver;
class LocalHand {
class LocalHand : public HandInterface{
public:
LocalHand(GuiInterface*, LocalBoard*, LocalPlayer**, int, int, int, int, int);
LocalHand(GuiInterface*, BoardInterface*, PlayerInterface**, int, int, int, int, int);
~LocalHand();
LocalPlayer** getPlayerArray() const { return playerArray; }
LocalBoard* getBoard() const { return myBoard; }
PlayerInterface** getPlayerArray() const { return playerArray; }
BoardInterface* getBoard() const { return myBoard; }
LocalPreflop* getPreflop() const { return myPreflop; }
LocalFlop* getFlop() const { return myFlop; }
LocalTurn* getTurn() const { return myTurn; }
@@ -64,6 +67,9 @@ public:
void setActualRound(const int& theValue) { actualRound = theValue; }
int getActualRound() const { return actualRound; }
void setDealerPosition(const int& theValue) { dealerPosition = theValue; }
int getDealerPosition() const { return dealerPosition; }
void setSmallBlind(const int& theValue) { smallBlind = theValue; }
int getSmallBlind() const { return smallBlind; }
@@ -79,12 +85,15 @@ public:
void switchRounds();
private:
GuiInterface *myGui;
LocalBoard *myBoard;
LocalPlayer **playerArray;
BoardInterface *myBoard;
PlayerInterface **playerArray;
LocalPreflop *myPreflop;
LocalFlop *myFlop;
LocalTurn *myTurn;
+1 -1
View File
@@ -23,7 +23,7 @@
using namespace std;
LocalPlayer::LocalPlayer(LocalBoard *b, int id, int sC, bool aS, int mB) : actualHand(0), actualBoard(b), myCardsValue(0), myID(id), myDude(0), myCardsValueInt(0), myCash(sC), mySet(0), myAction(0), myButton(mB), myActiveStatus(aS), myTurn(0), myRoundStartCash(0), myAverageSets(0)
LocalPlayer::LocalPlayer(BoardInterface *b, int id, int sC, bool aS, int mB) : PlayerInterface(), actualHand(0), actualBoard(b), myCardsValue(0), myID(id), myDude(0), myCardsValueInt(0), myCash(sC), mySet(0), myAction(0), myButton(mB), myActiveStatus(aS), myTurn(0), myRoundStartCash(0), myAverageSets(0)
{
Tools myTool;
+6 -4
View File
@@ -20,6 +20,8 @@
#ifndef LOCALPLAYER_H
#define LOCALPLAYER_H
#include "playerinterface.h"
#include "cardsvalue.h"
#include <string>
@@ -28,11 +30,11 @@
class CardsValue;
class LocalHand;
class LocalBoard;
class BoardInterface;
class LocalPlayer{
class LocalPlayer : public PlayerInterface{
public:
LocalPlayer(LocalBoard*, int, int, bool, int);
LocalPlayer(BoardInterface*, int, int, bool, int);
~LocalPlayer();
@@ -91,7 +93,7 @@ public:
private:
LocalHand *actualHand;
LocalBoard *actualBoard;
BoardInterface *actualBoard;
CardsValue *myCardsValue;