putting log from local_engine to engine; implementing hand-logging
This commit is contained in:
+2
-4
@@ -199,8 +199,7 @@ HEADERS += src/game.h \
|
|||||||
src/gui/qt/internetgamelogindialog/internetgamelogindialogimpl.h \
|
src/gui/qt/internetgamelogindialog/internetgamelogindialogimpl.h \
|
||||||
src/engine/local_engine/replay.h \
|
src/engine/local_engine/replay.h \
|
||||||
src/gui/qt/gamelobbydialog/mynicklistsortfilterproxymodel.h \
|
src/gui/qt/gamelobbydialog/mynicklistsortfilterproxymodel.h \
|
||||||
src/gui/qt/gametable/myslider.h \
|
src/gui/qt/gametable/myslider.h
|
||||||
src/engine/local_engine/log.h
|
|
||||||
FORMS += src/gui/qt/gametable.ui \
|
FORMS += src/gui/qt/gametable.ui \
|
||||||
src/gui/qt/aboutpokerth.ui \
|
src/gui/qt/aboutpokerth.ui \
|
||||||
src/gui/qt/connecttoserverdialog.ui \
|
src/gui/qt/connecttoserverdialog.ui \
|
||||||
@@ -268,8 +267,7 @@ SOURCES += src/pokerth.cpp \
|
|||||||
src/gui/qt/gamelobbydialog/mygamelistsortfilterproxymodel.cpp \
|
src/gui/qt/gamelobbydialog/mygamelistsortfilterproxymodel.cpp \
|
||||||
src/gui/qt/internetgamelogindialog/internetgamelogindialogimpl.cpp \
|
src/gui/qt/internetgamelogindialog/internetgamelogindialogimpl.cpp \
|
||||||
src/engine/local_engine/replay.cpp \
|
src/engine/local_engine/replay.cpp \
|
||||||
src/gui/qt/gamelobbydialog/mynicklistsortfilterproxymodel.cpp \
|
src/gui/qt/gamelobbydialog/mynicklistsortfilterproxymodel.cpp
|
||||||
src/engine/local_engine/log.cpp
|
|
||||||
TRANSLATIONS = ts/pokerth_af.ts \
|
TRANSLATIONS = ts/pokerth_af.ts \
|
||||||
ts/pokerth_bg.ts \
|
ts/pokerth_bg.ts \
|
||||||
ts/pokerth_zhcn.ts \
|
ts/pokerth_zhcn.ts \
|
||||||
|
|||||||
+2
-2
@@ -126,7 +126,7 @@ HEADERS += \
|
|||||||
src/engine/local_engine/localbero.h \
|
src/engine/local_engine/localbero.h \
|
||||||
src/engine/local_engine/localexception.h \
|
src/engine/local_engine/localexception.h \
|
||||||
src/engine/local_engine/arraydata.h \
|
src/engine/local_engine/arraydata.h \
|
||||||
src/engine/local_engine/log.h \
|
src/engine/log.h \
|
||||||
src/engine/network_engine/clientboard.h \
|
src/engine/network_engine/clientboard.h \
|
||||||
src/engine/network_engine/clientenginefactory.h \
|
src/engine/network_engine/clientenginefactory.h \
|
||||||
src/engine/network_engine/clienthand.h \
|
src/engine/network_engine/clienthand.h \
|
||||||
@@ -174,7 +174,7 @@ SOURCES += \
|
|||||||
src/engine/local_engine/localbero.cpp \
|
src/engine/local_engine/localbero.cpp \
|
||||||
src/engine/local_engine/localexception.cpp \
|
src/engine/local_engine/localexception.cpp \
|
||||||
src/engine/local_engine/arraydata.cpp \
|
src/engine/local_engine/arraydata.cpp \
|
||||||
src/engine/local_engine/log.cpp \
|
src/engine/log.cpp \
|
||||||
src/engine/network_engine/clientboard.cpp \
|
src/engine/network_engine/clientboard.cpp \
|
||||||
src/engine/network_engine/clientenginefactory.cpp \
|
src/engine/network_engine/clientenginefactory.cpp \
|
||||||
src/engine/network_engine/clienthand.cpp \
|
src/engine/network_engine/clienthand.cpp \
|
||||||
|
|||||||
@@ -24,14 +24,14 @@
|
|||||||
#include "handinterface.h"
|
#include "handinterface.h"
|
||||||
#include "playerinterface.h"
|
#include "playerinterface.h"
|
||||||
#include "berointerface.h"
|
#include "berointerface.h"
|
||||||
|
#include "log.h"
|
||||||
|
|
||||||
class EngineFactory{
|
class EngineFactory{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual ~EngineFactory();
|
virtual ~EngineFactory();
|
||||||
|
|
||||||
virtual HandInterface* createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC) =0;
|
virtual HandInterface* createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC) =0;
|
||||||
virtual BoardInterface* createBoard() =0;
|
virtual BoardInterface* createBoard() =0;
|
||||||
virtual boost::shared_ptr<PlayerInterface> createPlayer(BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB) =0;
|
virtual boost::shared_ptr<PlayerInterface> createPlayer(BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB) =0;
|
||||||
virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface* hi, int id, unsigned dP, int sB) =0;
|
virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface* hi, int id, unsigned dP, int sB) =0;
|
||||||
|
|||||||
@@ -42,7 +42,11 @@ LocalEngineFactory::~LocalEngineFactory()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HandInterface* LocalEngineFactory::createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC) { return new LocalHand(f, g, b, sl, apl, rpl, id, sP, dP, sB, sC); }
|
HandInterface*
|
||||||
|
LocalEngineFactory::createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC)
|
||||||
|
{
|
||||||
|
return new LocalHand(f, g, b, l, sl, apl, rpl, id, sP, dP, sB, sC);
|
||||||
|
}
|
||||||
|
|
||||||
BoardInterface* LocalEngineFactory::createBoard() { return new LocalBoard; }
|
BoardInterface* LocalEngineFactory::createBoard() { return new LocalBoard; }
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public:
|
|||||||
LocalEngineFactory(ConfigFile*);
|
LocalEngineFactory(ConfigFile*);
|
||||||
~LocalEngineFactory();
|
~LocalEngineFactory();
|
||||||
|
|
||||||
HandInterface* createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC);
|
HandInterface* createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC);
|
||||||
BoardInterface* createBoard();
|
BoardInterface* createBoard();
|
||||||
boost::shared_ptr<PlayerInterface> createPlayer(BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB);
|
boost::shared_ptr<PlayerInterface> createPlayer(BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB);
|
||||||
std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface* hi, int id, unsigned dP, int sB);
|
std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface* hi, int id, unsigned dP, int sB);
|
||||||
|
|||||||
@@ -30,8 +30,8 @@
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, unsigned dP, int sB,int sC)
|
LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, unsigned dP, int sB,int sC)
|
||||||
: myFactory(f), myGui(g), myBoard(b), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myBeRo(0), myID(id), startQuantityPlayers(sP), dealerPosition(dP), currentRound(0), smallBlind(sB), startCash(sC), lastPlayersTurn(-1), lastActionPlayer(0), allInCondition(false),
|
: myFactory(f), myGui(g), myBoard(b), myLog(l), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myBeRo(0), myID(id), startQuantityPlayers(sP), dealerPosition(dP), smallBlindPosition(dP), bigBlindPosition(dP), currentRound(0), smallBlind(sB), startCash(sC), lastPlayersTurn(-1), lastActionPlayer(0), allInCondition(false),
|
||||||
cardsShown(false), bettingRoundsPlayed(0)
|
cardsShown(false), bettingRoundsPlayed(0)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -358,6 +358,8 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
|
|||||||
// determine dealer, SB, BB
|
// determine dealer, SB, BB
|
||||||
assignButtons();
|
assignButtons();
|
||||||
|
|
||||||
|
myLog->logNewHandMsg(myID, dealerPosition, smallBlind, smallBlindPosition, 2*smallBlind, bigBlindPosition, seatsList);
|
||||||
|
|
||||||
myBeRo = myFactory->createBeRo(this, myID, dealerPosition, smallBlind);
|
myBeRo = myFactory->createBeRo(this, myID, dealerPosition, smallBlind);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -427,9 +429,11 @@ void LocalHand::assignButtons() {
|
|||||||
if(activePlayerList->size() > 2) {
|
if(activePlayerList->size() > 2) {
|
||||||
//small blind normal
|
//small blind normal
|
||||||
(*it)->setMyButton(2);
|
(*it)->setMyButton(2);
|
||||||
|
smallBlindPosition = (*it)->getMyUniqueID();
|
||||||
} else {
|
} else {
|
||||||
//big blind in heads up
|
//big blind in heads up
|
||||||
(*it)->setMyButton(3);
|
(*it)->setMyButton(3);
|
||||||
|
bigBlindPosition = (*it)->getMyUniqueID();
|
||||||
// lastPlayerAction for showing cards
|
// lastPlayerAction for showing cards
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -442,9 +446,11 @@ void LocalHand::assignButtons() {
|
|||||||
if(activePlayerList->size() > 2) {
|
if(activePlayerList->size() > 2) {
|
||||||
//big blind normal
|
//big blind normal
|
||||||
(*it)->setMyButton(3);
|
(*it)->setMyButton(3);
|
||||||
|
bigBlindPosition = (*it)->getMyUniqueID();
|
||||||
} else {
|
} else {
|
||||||
//small blind in heads up
|
//small blind in heads up
|
||||||
(*it)->setMyButton(2);
|
(*it)->setMyButton(2);
|
||||||
|
smallBlindPosition = (*it)->getMyUniqueID();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -31,10 +31,11 @@
|
|||||||
#include <handinterface.h>
|
#include <handinterface.h>
|
||||||
#include <berointerface.h>
|
#include <berointerface.h>
|
||||||
|
|
||||||
|
class Log;
|
||||||
|
|
||||||
class LocalHand : public HandInterface{
|
class LocalHand : public HandInterface{
|
||||||
public:
|
public:
|
||||||
LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface*, BoardInterface*, PlayerList, PlayerList, PlayerList, int, int, unsigned, int, int);
|
LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface*, BoardInterface*, Log*, PlayerList, PlayerList, PlayerList, int, int, unsigned, int, int);
|
||||||
~LocalHand();
|
~LocalHand();
|
||||||
|
|
||||||
void start();
|
void start();
|
||||||
@@ -98,16 +99,19 @@ private:
|
|||||||
boost::shared_ptr<EngineFactory> myFactory;
|
boost::shared_ptr<EngineFactory> myFactory;
|
||||||
GuiInterface *myGui;
|
GuiInterface *myGui;
|
||||||
BoardInterface *myBoard;
|
BoardInterface *myBoard;
|
||||||
|
Log *myLog;
|
||||||
|
|
||||||
PlayerList seatsList; // all player
|
PlayerList seatsList; // all player
|
||||||
PlayerList activePlayerList; // all player who are not out
|
PlayerList activePlayerList; // all player who are not out
|
||||||
PlayerList runningPlayerList; // all player who are not folded, not all in and not out
|
PlayerList runningPlayerList; // all player who are not folded, not all in and not out
|
||||||
|
|
||||||
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
|
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
|
||||||
|
|
||||||
int myID;
|
int myID;
|
||||||
int startQuantityPlayers;
|
int startQuantityPlayers;
|
||||||
unsigned dealerPosition;
|
unsigned dealerPosition;
|
||||||
|
unsigned smallBlindPosition;
|
||||||
|
unsigned bigBlindPosition;
|
||||||
int currentRound; //0 = preflop, 1 = flop, 2 = turn, 3 = river
|
int currentRound; //0 = preflop, 1 = flop, 2 = turn, 3 = river
|
||||||
int smallBlind;
|
int smallBlind;
|
||||||
int startCash;
|
int startCash;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
Log::Log(ConfigFile *c) : myConfig(c)
|
Log::Log(ConfigFile *c) : myConfig(c), curGameID(0)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(SQLITE_LOG) {
|
if(SQLITE_LOG) {
|
||||||
@@ -159,18 +159,20 @@ Log::~Log()
|
|||||||
void
|
void
|
||||||
Log::logNewGameMsg(int gameID, int startCash, int startSmallBlind, unsigned dealerPosition, PlayerList seatsList) {
|
Log::logNewGameMsg(int gameID, int startCash, int startSmallBlind, unsigned dealerPosition, PlayerList seatsList) {
|
||||||
|
|
||||||
if(SQLITE_LOG) {
|
curGameID = gameID;
|
||||||
|
|
||||||
PlayerListConstIterator it_c;
|
if(SQLITE_LOG) {
|
||||||
|
|
||||||
if(myConfig->readConfigInt("LogOnOff")) {
|
if(myConfig->readConfigInt("LogOnOff")) {
|
||||||
//if write logfiles is enabled
|
//if write logfiles is enabled
|
||||||
|
|
||||||
|
PlayerListConstIterator it_c;
|
||||||
string sql;
|
string sql;
|
||||||
int i;
|
int i;
|
||||||
char *errmsg;
|
char *errmsg;
|
||||||
|
|
||||||
if( mySqliteLogDb != 0 ) {
|
if( mySqliteLogDb != 0 ) {
|
||||||
|
// sqlite-db is open
|
||||||
|
|
||||||
sql = "INSERT INTO Game (";
|
sql = "INSERT INTO Game (";
|
||||||
sql += "GameID";
|
sql += "GameID";
|
||||||
@@ -181,11 +183,10 @@ Log::logNewGameMsg(int gameID, int startCash, int startSmallBlind, unsigned deal
|
|||||||
sql += ",Seat_" + boost::lexical_cast<std::string>(i);
|
sql += ",Seat_" + boost::lexical_cast<std::string>(i);
|
||||||
}
|
}
|
||||||
sql += ") VALUES (";
|
sql += ") VALUES (";
|
||||||
sql += boost::lexical_cast<string>(gameID);
|
sql += boost::lexical_cast<string>(curGameID);
|
||||||
sql += "," + boost::lexical_cast<string>(startCash);
|
sql += "," + boost::lexical_cast<string>(startCash);
|
||||||
sql += "," + boost::lexical_cast<string>(startSmallBlind);
|
sql += "," + boost::lexical_cast<string>(startSmallBlind);
|
||||||
sql += "," + boost::lexical_cast<string>(dealerPosition);
|
sql += "," + boost::lexical_cast<string>(dealerPosition);
|
||||||
|
|
||||||
for(it_c = seatsList->begin();it_c!=seatsList->end();it_c++) {
|
for(it_c = seatsList->begin();it_c!=seatsList->end();it_c++) {
|
||||||
if((*it_c)->getMyActiveStatus()) {
|
if((*it_c)->getMyActiveStatus()) {
|
||||||
sql += ",\"" + (*it_c)->getMyName() +"\"";
|
sql += ",\"" + (*it_c)->getMyName() +"\"";
|
||||||
@@ -202,6 +203,60 @@ Log::logNewGameMsg(int gameID, int startCash, int startSmallBlind, unsigned deal
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Log::logNewHandMsg(int handID, unsigned dealerPosition, int smallBlind, unsigned smallBlindPosition, int bigBlind, unsigned bigBlindPosition, PlayerList seatsList) {
|
||||||
|
|
||||||
|
if(SQLITE_LOG) {
|
||||||
|
|
||||||
|
if(myConfig->readConfigInt("LogOnOff")) {
|
||||||
|
//if write logfiles is enabled
|
||||||
|
|
||||||
|
PlayerListConstIterator it_c;
|
||||||
|
string sql;
|
||||||
|
int i;
|
||||||
|
char *errmsg;
|
||||||
|
|
||||||
|
if( mySqliteLogDb != 0 ) {
|
||||||
|
// sqlite-db is open
|
||||||
|
|
||||||
|
sql = "INSERT INTO Hand (";
|
||||||
|
sql += "HandID";
|
||||||
|
sql += ",GameID";
|
||||||
|
sql += ",Dealer_Seat";
|
||||||
|
sql += ",Sb_Amount";
|
||||||
|
sql += ",Sb_Seat";
|
||||||
|
sql += ",Bb_Amount";
|
||||||
|
sql += ",Bb_Seat";
|
||||||
|
for(i=1; i<=MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
|
sql += ",Seat_" + boost::lexical_cast<std::string>(i) + "_Cash";
|
||||||
|
}
|
||||||
|
sql += ") VALUES (";
|
||||||
|
sql += boost::lexical_cast<string>(handID);
|
||||||
|
sql += "," + boost::lexical_cast<string>(curGameID);
|
||||||
|
sql += "," + boost::lexical_cast<string>(dealerPosition+1);
|
||||||
|
sql += "," + boost::lexical_cast<string>(smallBlind);
|
||||||
|
sql += "," + boost::lexical_cast<string>(smallBlindPosition+1);
|
||||||
|
sql += "," + boost::lexical_cast<string>(bigBlind);
|
||||||
|
sql += "," + boost::lexical_cast<string>(bigBlindPosition+1);
|
||||||
|
for(it_c = seatsList->begin();it_c!=seatsList->end();it_c++) {
|
||||||
|
if((*it_c)->getMyActiveStatus()) {
|
||||||
|
sql += "," + boost::lexical_cast<string>((*it_c)->getMyCash());
|
||||||
|
} else {
|
||||||
|
sql += ",NULL";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sql += ")";
|
||||||
|
if(sqlite3_exec(mySqliteLogDb, sql.data(), 0, 0, &errmsg) != SQLITE_OK) {
|
||||||
|
cout << "Error in statement: " << sql.data() << "[" << errmsg << "]." << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//void
|
//void
|
||||||
//Log::closeLogDbAtExit()
|
//Log::closeLogDbAtExit()
|
||||||
//{
|
//{
|
||||||
@@ -40,12 +40,14 @@ public:
|
|||||||
~Log();
|
~Log();
|
||||||
|
|
||||||
void logNewGameMsg(int gameID, int startCash, int startSmallBlind, unsigned dealerPosition, PlayerList seatsList);
|
void logNewGameMsg(int gameID, int startCash, int startSmallBlind, unsigned dealerPosition, PlayerList seatsList);
|
||||||
|
void logNewHandMsg(int handID, unsigned dealerPosition, int smallBlind, unsigned smallBlindPosition, int bigBlind, unsigned bigBlindPosition, PlayerList seatsList);
|
||||||
// void closeLogDbAtExit();
|
// void closeLogDbAtExit();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ConfigFile *myConfig;
|
ConfigFile *myConfig;
|
||||||
sqlite3 *mySqliteLogDb;
|
sqlite3 *mySqliteLogDb;
|
||||||
|
int curGameID;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -35,9 +35,9 @@ ClientEngineFactory::~ClientEngineFactory()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HandInterface* ClientEngineFactory::createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC)
|
HandInterface* ClientEngineFactory::createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC)
|
||||||
{
|
{
|
||||||
return new ClientHand(f, g, b, sl, apl, rpl, id, sP, dP, sB, sC);
|
return new ClientHand(f, g, b, l, sl, apl, rpl, id, sP, dP, sB, sC);
|
||||||
}
|
}
|
||||||
|
|
||||||
BoardInterface* ClientEngineFactory::createBoard()
|
BoardInterface* ClientEngineFactory::createBoard()
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
#include <handinterface.h>
|
#include <handinterface.h>
|
||||||
#include <boardinterface.h>
|
#include <boardinterface.h>
|
||||||
#include <playerinterface.h>
|
#include <playerinterface.h>
|
||||||
|
#include <log.h>
|
||||||
|
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -37,7 +38,7 @@ public:
|
|||||||
ClientEngineFactory();
|
ClientEngineFactory();
|
||||||
~ClientEngineFactory();
|
~ClientEngineFactory();
|
||||||
|
|
||||||
HandInterface* createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC);
|
HandInterface* createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC);
|
||||||
BoardInterface* createBoard();
|
BoardInterface* createBoard();
|
||||||
boost::shared_ptr<PlayerInterface> createPlayer(BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB);
|
boost::shared_ptr<PlayerInterface> createPlayer(BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB);
|
||||||
std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface* hi, int id, unsigned dP, int sB);
|
std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface* hi, int id, unsigned dP, int sB);
|
||||||
|
|||||||
@@ -21,8 +21,8 @@
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
ClientHand::ClientHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC)
|
ClientHand::ClientHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC)
|
||||||
: myFactory(f), myGui(g), myBoard(b), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myID(id), startQuantityPlayers(sP), dealerPosition(dP), currentRound(0),
|
: myFactory(f), myGui(g), myBoard(b), myLog(l), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myID(id), startQuantityPlayers(sP), dealerPosition(dP), currentRound(0),
|
||||||
smallBlind(sB), startCash(sC), lastPlayersTurn(-1), allInCondition(0),
|
smallBlind(sB), startCash(sC), lastPlayersTurn(-1), allInCondition(0),
|
||||||
cardsShown(false), bettingRoundsPlayed(0)
|
cardsShown(false), bettingRoundsPlayed(0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include <playerinterface.h>
|
#include <playerinterface.h>
|
||||||
#include <handinterface.h>
|
#include <handinterface.h>
|
||||||
#include <berointerface.h>
|
#include <berointerface.h>
|
||||||
|
#include <log.h>
|
||||||
#include <boost/thread.hpp>
|
#include <boost/thread.hpp>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -32,7 +33,7 @@
|
|||||||
class ClientHand : public HandInterface
|
class ClientHand : public HandInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ClientHand ( boost::shared_ptr<EngineFactory> f, GuiInterface*, BoardInterface*, PlayerList, PlayerList, PlayerList , int, int, int, int, int );
|
ClientHand ( boost::shared_ptr<EngineFactory> f, GuiInterface*, BoardInterface*, Log*, PlayerList, PlayerList, PlayerList , int, int, int, int, int );
|
||||||
~ClientHand();
|
~ClientHand();
|
||||||
|
|
||||||
void start();
|
void start();
|
||||||
@@ -98,6 +99,7 @@ class ClientHand : public HandInterface
|
|||||||
boost::shared_ptr<EngineFactory> myFactory;
|
boost::shared_ptr<EngineFactory> myFactory;
|
||||||
GuiInterface *myGui;
|
GuiInterface *myGui;
|
||||||
BoardInterface *myBoard;
|
BoardInterface *myBoard;
|
||||||
|
Log *myLog;
|
||||||
|
|
||||||
PlayerList seatsList;
|
PlayerList seatsList;
|
||||||
PlayerList activePlayerList;
|
PlayerList activePlayerList;
|
||||||
|
|||||||
+1
-1
@@ -174,7 +174,7 @@ void Game::initHand()
|
|||||||
(*runningPlayerList) = (*activePlayerList);
|
(*runningPlayerList) = (*activePlayerList);
|
||||||
|
|
||||||
// create Hand
|
// create Hand
|
||||||
currentHand = myFactory->createHand(myFactory, myGui, currentBoard, seatsList, activePlayerList, runningPlayerList, currentHandID, startQuantityPlayers, dealerPosition, currentSmallBlind, startCash);
|
currentHand = myFactory->createHand(myFactory, myGui, currentBoard, myLog, seatsList, activePlayerList, runningPlayerList, currentHandID, startQuantityPlayers, dealerPosition, currentSmallBlind, startCash);
|
||||||
|
|
||||||
// shifting dealer button -> TODO exception-rule !!!
|
// shifting dealer button -> TODO exception-rule !!!
|
||||||
bool nextDealerFound = false;
|
bool nextDealerFound = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user