This commit is contained in:
+4
-1
@@ -31,7 +31,7 @@
|
||||
|
||||
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";
|
||||
int i;
|
||||
@@ -142,5 +142,8 @@ void Game::startHand()
|
||||
} while(!(playerArray[dealerPosition]->getMyActiveStatus()));
|
||||
|
||||
|
||||
myGui->logNewGameHandMsg(myGameID, actualHandID);
|
||||
|
||||
|
||||
// Abfrage Cash==0 -> player inactive -> actualQuantityPlayer--
|
||||
}
|
||||
|
||||
+6
-2
@@ -35,7 +35,7 @@ class ConfigFile;
|
||||
class Game {
|
||||
|
||||
public:
|
||||
Game(ConfigFile*, GuiInterface*, int, int, int);
|
||||
Game(ConfigFile*, GuiInterface*, int, int, int, int);
|
||||
|
||||
~Game();
|
||||
|
||||
@@ -52,6 +52,10 @@ public:
|
||||
void setDealerPosition(const int& theValue) { dealerPosition = theValue; }
|
||||
int getDealerPosition() const { return dealerPosition; }
|
||||
|
||||
void setMyGameID(const int& theValue) { myGameID = theValue;}
|
||||
int getMyGameID() const { return myGameID; }
|
||||
|
||||
|
||||
|
||||
//Zufgriff Laufvariablen
|
||||
void setActualQuantityPlayers(const int& theValue) { actualQuantityPlayers = theValue; }
|
||||
@@ -83,11 +87,11 @@ private:
|
||||
BoardInterface *actualBoard;
|
||||
PlayerInterface *playerArray[5];
|
||||
|
||||
|
||||
//Startvariablen
|
||||
int startQuantityPlayers;
|
||||
int startCash;
|
||||
int startSmallBlind;
|
||||
int myGameID;
|
||||
|
||||
//Laufvariablen
|
||||
int actualQuantityPlayers;
|
||||
|
||||
@@ -92,7 +92,8 @@ public:
|
||||
|
||||
|
||||
//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::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 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:
|
||||
|
||||
|
||||
+39
-12
@@ -38,18 +38,16 @@ Log::Log(mainWindowImpl* w) : myW(w)
|
||||
|
||||
myLogFile->open( QIODevice::WriteOnly );
|
||||
QTextStream stream( myLogFile );
|
||||
stream << "<html>";
|
||||
stream << "<body>";
|
||||
stream << "<img src='logo.png'>";
|
||||
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 << "</body>";
|
||||
stream << "</html>";
|
||||
stream << "<html>\n";
|
||||
stream << "<body>\n";
|
||||
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>\n";
|
||||
stream << "</body>\n";
|
||||
stream << "</html>\n";
|
||||
myLogFile->close();
|
||||
|
||||
linesInFile = 5;
|
||||
}
|
||||
|
||||
|
||||
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
@@ -57,8 +55,10 @@ 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;
|
||||
msg = QString::fromStdString(playerName);
|
||||
|
||||
@@ -83,7 +83,34 @@ void Log::logPlayerActionMsg(string playerName, int action, int setValue) const
|
||||
|
||||
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();
|
||||
|
||||
|
||||
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:
|
||||
|
||||
int linesInFile;
|
||||
|
||||
mainWindowImpl *myW;
|
||||
ConfigFile *myConfig;
|
||||
QFile *myLogFile;
|
||||
|
||||
@@ -578,7 +578,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="pixmap" >
|
||||
<pixmap resource="deck.qrc" >:/graphics/graphics/logo-140-100.png</pixmap>
|
||||
<pixmap/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -4036,7 +4036,7 @@
|
||||
<tabstop>pushButton_allin</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="deck.qrc" />
|
||||
<include location="../deck.qrc" />
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
|
||||
@@ -352,6 +352,9 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent)
|
||||
inactive.setRgb(83,141,107);
|
||||
highlight.setRgb(151,214,109);
|
||||
|
||||
//ShortCuts
|
||||
// QShortcut *startNewGameKeys = new QShortcut(QKeySequence(Qt::Key_Control), Ui::mainWindow);
|
||||
|
||||
//Connects
|
||||
connect(dealFlopCards0Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards1() ));
|
||||
connect(dealFlopCards1Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards2() ));
|
||||
@@ -385,6 +388,9 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent)
|
||||
connect(postRiverRunAnimation5Timer, SIGNAL(timeout()), this, SLOT( postRiverRunAnimation6() ));
|
||||
connect(postRiverRunAnimation6Timer, SIGNAL(timeout()), this, SLOT( startNewHand() ));
|
||||
|
||||
|
||||
|
||||
// connect( startNewGameKeys, SIGNAL(activated() ), this, SLOT( callNewGameDialog() ) );
|
||||
connect( actionNewGame, SIGNAL( triggered() ), this, SLOT( callNewGameDialog() ) );
|
||||
connect( actionAboutPokerth, SIGNAL( triggered() ), this, SLOT( callAboutPokerthDialog() ) );
|
||||
connect( actionSettings, SIGNAL( triggered() ), this, SLOT( callSettingsDialog() ) );
|
||||
@@ -560,8 +566,8 @@ void mainWindowImpl::refreshSet() {
|
||||
|
||||
void mainWindowImpl::refreshButton() {
|
||||
|
||||
QPixmap dealerButton(":/graphics/cards/dealerbutton.png");
|
||||
QPixmap onePix(":/graphics/cards/1px.png");
|
||||
QPixmap dealerButton(":/graphics/graphics/dealerbutton.png");
|
||||
QPixmap onePix(":/graphics/graphics/1px.png");
|
||||
|
||||
int i;
|
||||
for (i=0; i<maxQuantityPlayers; i++) {
|
||||
@@ -593,7 +599,7 @@ void mainWindowImpl::refreshAction() {
|
||||
|
||||
if (actualHand->getPlayerArray()[i]->getMyAction()==1) {
|
||||
groupBoxArray[i]->setDisabled(TRUE);
|
||||
QPixmap onePix(":/graphics/cards/1px.png");
|
||||
QPixmap onePix(":/graphics/graphics/1px.png");
|
||||
if(i != 0) {
|
||||
holeCardsArray[i][0]->setPixmap(onePix, FALSE);
|
||||
holeCardsArray[i][1]->setPixmap(onePix, FALSE);
|
||||
@@ -1744,11 +1750,17 @@ void mainWindowImpl::paintStartSplash() {
|
||||
|
||||
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() == 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();
|
||||
|
||||
|
||||
|
||||
+3
-1
@@ -29,6 +29,7 @@ using namespace std;
|
||||
Session::Session(GuiInterface* g) : actualGame(0), myGui(g)
|
||||
{
|
||||
|
||||
actualGameID = 0;
|
||||
// Session an mainwindowimpl bergeben
|
||||
myGui->setSession(this);
|
||||
|
||||
@@ -45,8 +46,9 @@ Session::~Session()
|
||||
|
||||
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() {
|
||||
|
||||
@@ -38,9 +38,15 @@ public:
|
||||
void startGame(int, int, int);
|
||||
void deleteGame();
|
||||
|
||||
void setActualGameID(const int& theValue) { actualGameID = theValue; }
|
||||
int getActualGameID() const { return actualGameID; }
|
||||
|
||||
// void createConfig();
|
||||
|
||||
private:
|
||||
|
||||
int actualGameID;
|
||||
|
||||
Game *actualGame;
|
||||
GuiInterface *myGui;
|
||||
ConfigFile *myConfig;
|
||||
|
||||
Reference in New Issue
Block a user