This commit is contained in:
+4
-1
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
Game::Game(ConfigFile* c, GuiInterface* g, int qP, int sC, int sB) : myConfig(c), myGui(g), actualHand(0), actualBoard(0), startQuantityPlayers(qP), startCash(sC), startSmallBlind(sB), actualQuantityPlayers(qP), actualSmallBlind(sB), actualHandID(0), dealerPosition(0)
|
Game::Game(ConfigFile* c, GuiInterface* g, int qP, int sC, int sB, int gId) : myConfig(c), myGui(g), actualHand(0), actualBoard(0), startQuantityPlayers(qP), startCash(sC), startSmallBlind(sB), myGameID(gId), actualQuantityPlayers(qP), actualSmallBlind(sB), actualHandID(0), dealerPosition(0)
|
||||||
{
|
{
|
||||||
// cout << "Create Game Object" << "\n";
|
// cout << "Create Game Object" << "\n";
|
||||||
int i;
|
int i;
|
||||||
@@ -142,5 +142,8 @@ void Game::startHand()
|
|||||||
} while(!(playerArray[dealerPosition]->getMyActiveStatus()));
|
} while(!(playerArray[dealerPosition]->getMyActiveStatus()));
|
||||||
|
|
||||||
|
|
||||||
|
myGui->logNewGameHandMsg(myGameID, actualHandID);
|
||||||
|
|
||||||
|
|
||||||
// Abfrage Cash==0 -> player inactive -> actualQuantityPlayer--
|
// Abfrage Cash==0 -> player inactive -> actualQuantityPlayer--
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-2
@@ -35,7 +35,7 @@ class ConfigFile;
|
|||||||
class Game {
|
class Game {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Game(ConfigFile*, GuiInterface*, int, int, int);
|
Game(ConfigFile*, GuiInterface*, int, int, int, int);
|
||||||
|
|
||||||
~Game();
|
~Game();
|
||||||
|
|
||||||
@@ -52,6 +52,10 @@ public:
|
|||||||
void setDealerPosition(const int& theValue) { dealerPosition = theValue; }
|
void setDealerPosition(const int& theValue) { dealerPosition = theValue; }
|
||||||
int getDealerPosition() const { return dealerPosition; }
|
int getDealerPosition() const { return dealerPosition; }
|
||||||
|
|
||||||
|
void setMyGameID(const int& theValue) { myGameID = theValue;}
|
||||||
|
int getMyGameID() const { return myGameID; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Zufgriff Laufvariablen
|
//Zufgriff Laufvariablen
|
||||||
void setActualQuantityPlayers(const int& theValue) { actualQuantityPlayers = theValue; }
|
void setActualQuantityPlayers(const int& theValue) { actualQuantityPlayers = theValue; }
|
||||||
@@ -83,11 +87,11 @@ private:
|
|||||||
BoardInterface *actualBoard;
|
BoardInterface *actualBoard;
|
||||||
PlayerInterface *playerArray[5];
|
PlayerInterface *playerArray[5];
|
||||||
|
|
||||||
|
|
||||||
//Startvariablen
|
//Startvariablen
|
||||||
int startQuantityPlayers;
|
int startQuantityPlayers;
|
||||||
int startCash;
|
int startCash;
|
||||||
int startSmallBlind;
|
int startSmallBlind;
|
||||||
|
int myGameID;
|
||||||
|
|
||||||
//Laufvariablen
|
//Laufvariablen
|
||||||
int actualQuantityPlayers;
|
int actualQuantityPlayers;
|
||||||
|
|||||||
@@ -92,7 +92,8 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//log.cpp
|
//log.cpp
|
||||||
virtual void logPlayerActionMsg(std::string playName, int action, int setValue) const=0;
|
virtual void logPlayerActionMsg(std::string playName, int action, int setValue) =0;
|
||||||
|
virtual void logNewGameHandMsg(int gameID, int HandID) =0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ void GuiWrapper::nextRoundCleanGui() const { myW->nextRoundCleanGui(); }
|
|||||||
|
|
||||||
void GuiWrapper::meInAction() const { myW->meInAction(); }
|
void GuiWrapper::meInAction() const { myW->meInAction(); }
|
||||||
|
|
||||||
void GuiWrapper::logPlayerActionMsg(string playerName, int action, int setValue) const { myLog->logPlayerActionMsg(playerName, action, setValue); }
|
void GuiWrapper::logPlayerActionMsg(string playerName, int action, int setValue) { myLog->logPlayerActionMsg(playerName, action, setValue); }
|
||||||
|
void GuiWrapper::logNewGameHandMsg(int gameID, int handID) { myLog->logNewGameHandMsg(gameID, handID); }
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,8 @@ public:
|
|||||||
|
|
||||||
void meInAction() const;
|
void meInAction() const;
|
||||||
|
|
||||||
void logPlayerActionMsg(std::string playerName, int action, int setValue) const;
|
void logPlayerActionMsg(std::string playerName, int action, int setValue) ;
|
||||||
|
void logNewGameHandMsg(int gameID, int handID) ;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
+38
-11
@@ -38,26 +38,26 @@ Log::Log(mainWindowImpl* w) : myW(w)
|
|||||||
|
|
||||||
myLogFile->open( QIODevice::WriteOnly );
|
myLogFile->open( QIODevice::WriteOnly );
|
||||||
QTextStream stream( myLogFile );
|
QTextStream stream( myLogFile );
|
||||||
stream << "<html>";
|
stream << "<html>\n";
|
||||||
stream << "<body>";
|
stream << "<body>\n";
|
||||||
stream << "<img src='logo.png'>";
|
stream << "<img src='logo.png'>\n";
|
||||||
stream << "<h3><b>Log-File for PokerTH Session started on "+QDate::currentDate().toString("yyyy-MM-dd")+" at "+QTime::currentTime().toString("hh:mm:ss")+"</b></h3>";
|
stream << "<h3><b>Log-File for PokerTH Session started on "+QDate::currentDate().toString("yyyy-MM-dd")+" at "+QTime::currentTime().toString("hh:mm:ss")+"</b></h3>\n";
|
||||||
stream << "</body>";
|
stream << "</body>\n";
|
||||||
stream << "</html>";
|
stream << "</html>\n";
|
||||||
myLogFile->close();
|
myLogFile->close();
|
||||||
|
|
||||||
|
linesInFile = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Log::~Log()
|
Log::~Log()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Log::logPlayerActionMsg(string playerName, int action, int setValue) const {
|
void Log::logPlayerActionMsg(string playerName, int action, int setValue) {
|
||||||
|
|
||||||
|
int i;
|
||||||
|
|
||||||
QString msg;
|
QString msg;
|
||||||
msg = QString::fromStdString(playerName);
|
msg = QString::fromStdString(playerName);
|
||||||
@@ -83,7 +83,34 @@ void Log::logPlayerActionMsg(string playerName, int action, int setValue) const
|
|||||||
|
|
||||||
myW->textBrowser_Log->append(msg);
|
myW->textBrowser_Log->append(msg);
|
||||||
|
|
||||||
|
myLogFile->open( QIODevice::ReadWrite );
|
||||||
|
QTextStream stream( myLogFile );
|
||||||
|
for(i=0; i<=linesInFile-2; i++) { stream.readLine(); }
|
||||||
|
stream << msg+"</br>\n";
|
||||||
|
stream << "</body>\n";
|
||||||
|
stream << "</html>\n";
|
||||||
|
myLogFile->close();
|
||||||
|
|
||||||
|
linesInFile++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Log::logNewGameHandMsg(int gameID, int handID) {
|
||||||
|
|
||||||
|
int i;
|
||||||
|
|
||||||
|
myW->textBrowser_Log->append("## Game: "+QString::number(gameID,10)+" | Hand: "+QString::number(handID,10)+" ##");
|
||||||
|
|
||||||
|
myLogFile->open( QIODevice::ReadWrite );
|
||||||
|
QTextStream stream( myLogFile );
|
||||||
|
for(i=0; i<=linesInFile-2; i++) { stream.readLine(); }
|
||||||
|
|
||||||
|
QString msg("<p style='text-weight:bold;'>##### Game: "+QString::number(gameID,10)+" | Hand: "+QString::number(handID,10)+" #####<p>");
|
||||||
|
stream << msg << "\n";
|
||||||
|
stream << "</body>\n";
|
||||||
|
stream << "</html>\n";
|
||||||
|
myLogFile->close();
|
||||||
|
|
||||||
|
linesInFile++;
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
+4
-1
@@ -40,11 +40,14 @@ public:
|
|||||||
~Log();
|
~Log();
|
||||||
|
|
||||||
|
|
||||||
void logPlayerActionMsg(std::string playName, int action, int setValue) const;
|
void logPlayerActionMsg(std::string playName, int action, int setValue);
|
||||||
|
void logNewGameHandMsg(int gameID, int handID);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
int linesInFile;
|
||||||
|
|
||||||
mainWindowImpl *myW;
|
mainWindowImpl *myW;
|
||||||
ConfigFile *myConfig;
|
ConfigFile *myConfig;
|
||||||
QFile *myLogFile;
|
QFile *myLogFile;
|
||||||
|
|||||||
@@ -578,7 +578,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="pixmap" >
|
<property name="pixmap" >
|
||||||
<pixmap resource="deck.qrc" >:/graphics/graphics/logo-140-100.png</pixmap>
|
<pixmap/>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -4036,7 +4036,7 @@
|
|||||||
<tabstop>pushButton_allin</tabstop>
|
<tabstop>pushButton_allin</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="deck.qrc" />
|
<include location="../deck.qrc" />
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
|||||||
@@ -352,6 +352,9 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent)
|
|||||||
inactive.setRgb(83,141,107);
|
inactive.setRgb(83,141,107);
|
||||||
highlight.setRgb(151,214,109);
|
highlight.setRgb(151,214,109);
|
||||||
|
|
||||||
|
//ShortCuts
|
||||||
|
// QShortcut *startNewGameKeys = new QShortcut(QKeySequence(Qt::Key_Control), Ui::mainWindow);
|
||||||
|
|
||||||
//Connects
|
//Connects
|
||||||
connect(dealFlopCards0Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards1() ));
|
connect(dealFlopCards0Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards1() ));
|
||||||
connect(dealFlopCards1Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards2() ));
|
connect(dealFlopCards1Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards2() ));
|
||||||
@@ -385,6 +388,9 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent)
|
|||||||
connect(postRiverRunAnimation5Timer, SIGNAL(timeout()), this, SLOT( postRiverRunAnimation6() ));
|
connect(postRiverRunAnimation5Timer, SIGNAL(timeout()), this, SLOT( postRiverRunAnimation6() ));
|
||||||
connect(postRiverRunAnimation6Timer, SIGNAL(timeout()), this, SLOT( startNewHand() ));
|
connect(postRiverRunAnimation6Timer, SIGNAL(timeout()), this, SLOT( startNewHand() ));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// connect( startNewGameKeys, SIGNAL(activated() ), this, SLOT( callNewGameDialog() ) );
|
||||||
connect( actionNewGame, SIGNAL( triggered() ), this, SLOT( callNewGameDialog() ) );
|
connect( actionNewGame, SIGNAL( triggered() ), this, SLOT( callNewGameDialog() ) );
|
||||||
connect( actionAboutPokerth, SIGNAL( triggered() ), this, SLOT( callAboutPokerthDialog() ) );
|
connect( actionAboutPokerth, SIGNAL( triggered() ), this, SLOT( callAboutPokerthDialog() ) );
|
||||||
connect( actionSettings, SIGNAL( triggered() ), this, SLOT( callSettingsDialog() ) );
|
connect( actionSettings, SIGNAL( triggered() ), this, SLOT( callSettingsDialog() ) );
|
||||||
@@ -560,8 +566,8 @@ void mainWindowImpl::refreshSet() {
|
|||||||
|
|
||||||
void mainWindowImpl::refreshButton() {
|
void mainWindowImpl::refreshButton() {
|
||||||
|
|
||||||
QPixmap dealerButton(":/graphics/cards/dealerbutton.png");
|
QPixmap dealerButton(":/graphics/graphics/dealerbutton.png");
|
||||||
QPixmap onePix(":/graphics/cards/1px.png");
|
QPixmap onePix(":/graphics/graphics/1px.png");
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
for (i=0; i<maxQuantityPlayers; i++) {
|
for (i=0; i<maxQuantityPlayers; i++) {
|
||||||
@@ -593,7 +599,7 @@ void mainWindowImpl::refreshAction() {
|
|||||||
|
|
||||||
if (actualHand->getPlayerArray()[i]->getMyAction()==1) {
|
if (actualHand->getPlayerArray()[i]->getMyAction()==1) {
|
||||||
groupBoxArray[i]->setDisabled(TRUE);
|
groupBoxArray[i]->setDisabled(TRUE);
|
||||||
QPixmap onePix(":/graphics/cards/1px.png");
|
QPixmap onePix(":/graphics/graphics/1px.png");
|
||||||
if(i != 0) {
|
if(i != 0) {
|
||||||
holeCardsArray[i][0]->setPixmap(onePix, FALSE);
|
holeCardsArray[i][0]->setPixmap(onePix, FALSE);
|
||||||
holeCardsArray[i][1]->setPixmap(onePix, FALSE);
|
holeCardsArray[i][1]->setPixmap(onePix, FALSE);
|
||||||
@@ -1744,11 +1750,17 @@ void mainWindowImpl::paintStartSplash() {
|
|||||||
|
|
||||||
void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) {
|
void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) {
|
||||||
|
|
||||||
// cout << event->key() << endl;
|
cout << event->key() << endl;
|
||||||
|
|
||||||
|
bool ctrlPressed = FALSE;
|
||||||
|
|
||||||
if (event->key() == 16777220) { if(spinBox_set->hasFocus()) pushButton_set->click(); } //ENTER
|
if (event->key() == 16777220) { if(spinBox_set->hasFocus()) pushButton_set->click(); } //ENTER
|
||||||
if (event->key() == 16777265) { switchToolBox(); } //F2
|
if (event->key() == 16777265) { switchToolBox(); } //F2
|
||||||
if (event->key() == 16777249) { pushButton_break->click(); } //CTRL
|
if (event->key() == 16777249) {
|
||||||
|
pushButton_break->click();
|
||||||
|
ctrlPressed = TRUE;
|
||||||
|
// QTimer::SingleShot
|
||||||
|
} //CTRL
|
||||||
// if (event->key() == 65) { paintStartSplash();
|
// if (event->key() == 65) { paintStartSplash();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -29,6 +29,7 @@ using namespace std;
|
|||||||
Session::Session(GuiInterface* g) : actualGame(0), myGui(g)
|
Session::Session(GuiInterface* g) : actualGame(0), myGui(g)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
actualGameID = 0;
|
||||||
// Session an mainwindowimpl bergeben
|
// Session an mainwindowimpl bergeben
|
||||||
myGui->setSession(this);
|
myGui->setSession(this);
|
||||||
|
|
||||||
@@ -45,8 +46,9 @@ Session::~Session()
|
|||||||
|
|
||||||
void Session::startGame(int qP, int sC, int sB) {
|
void Session::startGame(int qP, int sC, int sB) {
|
||||||
|
|
||||||
actualGame = new Game(myConfig, myGui, qP, sC, sB);
|
actualGameID++;
|
||||||
|
|
||||||
|
actualGame = new Game(myConfig, myGui, qP, sC, sB, actualGameID);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::deleteGame() {
|
void Session::deleteGame() {
|
||||||
|
|||||||
@@ -38,9 +38,15 @@ public:
|
|||||||
void startGame(int, int, int);
|
void startGame(int, int, int);
|
||||||
void deleteGame();
|
void deleteGame();
|
||||||
|
|
||||||
|
void setActualGameID(const int& theValue) { actualGameID = theValue; }
|
||||||
|
int getActualGameID() const { return actualGameID; }
|
||||||
|
|
||||||
// void createConfig();
|
// void createConfig();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
int actualGameID;
|
||||||
|
|
||||||
Game *actualGame;
|
Game *actualGame;
|
||||||
GuiInterface *myGui;
|
GuiInterface *myGui;
|
||||||
ConfigFile *myConfig;
|
ConfigFile *myConfig;
|
||||||
|
|||||||
Reference in New Issue
Block a user