Skip to content

Commit

Permalink
updated uml class dia and moved winnerdialog into seperate header file
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertHue committed Apr 17, 2019
1 parent e7aeeb7 commit 1519f89
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 47 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -52,7 +52,7 @@ set(CMAKE_AUTOMOC ON)
# Create code from a list of Qt designer ui files
set(CMAKE_AUTOUIC ON)
# Find the QtWidgets library
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Widgets CONFIG REQUIRED)



Expand Down
2 changes: 1 addition & 1 deletion include/GameAI_Thread.h
@@ -1,5 +1,5 @@
#pragma once
#include <qthread.h>
#include <QThread>

#include "GameAI.h"
#include "QGameStateModel.h"
Expand Down
2 changes: 0 additions & 2 deletions include/GameState.h
Expand Up @@ -5,8 +5,6 @@
#include <stdlib.h>


// see https://doc.qt.io/qt-5/model-view-programming.html#rows-and-columns


const bool NO_VALID_MOVE = false;
const bool VALID_MOVE = true;
Expand Down
43 changes: 0 additions & 43 deletions include/QGameStateModel.h
@@ -1,18 +1,8 @@
#pragma once

#include <QAbstractTableModel>
#include <QAbstractItemModel>
#include <QModelIndex>
#include <QFont>
#include <QBrush>

#include <QAbstractTableModel>
#include <QStringList>
#include <QVariant>

#include <mutex>
#include <condition_variable>

#include "GameState.h"
/**
@brief functions as a adapter for the GameState
Expand Down Expand Up @@ -69,37 +59,4 @@ public slots:
Player m_playerOpp;
GameState m_gameState;
bool m_endOfGame;
};

////////////////////////////////////////////////

#include <QDialog>
#include <QLabel>
#include <QFont>
#include <QVBoxLayout>

class WinnerDialog : public QDialog {
Q_OBJECT

public:
WinnerDialog(const QString& text, QWidget * parent = 0)
: QDialog(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout;
this->setModal(true);
this->setWindowTitle("Connect-Four Who won?");
this->resize(260, 180);
this->setWindowFlags(Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
this->setLayout(mainLayout);


QFont sansFont("Helvetica [Cronyx]", 18);
QFont f("Arial", 10, QFont::Bold);
QLabel *label = new QLabel();
label->setStyleSheet(
"font: large 28px; font-weight: bold; text-align: center; color: rgb(200,100,150)"
);
label->setText(text);
mainLayout->addWidget(label);
}
};
32 changes: 32 additions & 0 deletions include/WinnerDialog.h
@@ -0,0 +1,32 @@
#pragma once

#include <QDialog>
#include <QLabel>
#include <QFont>
#include <QVBoxLayout>

class WinnerDialog : public QDialog {
Q_OBJECT

public:
WinnerDialog(const QString& text, QWidget * parent = 0)
: QDialog(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout;
this->setModal(true);
this->setWindowTitle("Connect-Four Who won?");
this->resize(260, 180);
this->setWindowFlags(Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
this->setLayout(mainLayout);


QFont sansFont("Helvetica [Cronyx]", 18);
QFont f("Arial", 10, QFont::Bold);
QLabel *label = new QLabel();
label->setStyleSheet(
"font: large 28px; font-weight: bold; text-align: center; color: rgb(200,100,150)"
);
label->setText(text);
mainLayout->addWidget(label);
}
};
Binary file added resources/UML_class_dia.dia
Binary file not shown.
Binary file added resources/UML_class_dia.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed resources/mcts_connectFour.png
Binary file not shown.
1 change: 1 addition & 0 deletions src/QGameStateModel.cpp
@@ -1,4 +1,5 @@
#include "QGameStateModel.h"
#include "WinnerDialog.h"
//////////////////////////////////////////////////////////////////////


Expand Down
1 change: 1 addition & 0 deletions src/main.cpp
Expand Up @@ -13,6 +13,7 @@

const int MAX_X = 7;
const int MAX_Y = 5;

int main(int argc, char* argv[]) {
QApplication app(argc, argv);

Expand Down

0 comments on commit 1519f89

Please sign in to comment.