-
Notifications
You must be signed in to change notification settings - Fork 0
/
gamewindow.cpp
32 lines (27 loc) · 874 Bytes
/
gamewindow.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "gamewindow.h"
#include "ui_gamewindow.h"
GameWindow::GameWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::GameWindow)
{
ui->setupUi(this);
board = new Board(ui->groupBox);
ui->groupBox->setLayout(board->getBoard());
connect(board, SIGNAL(messageCreated(QString)), this, SLOT(takeMessage(QString)));
this->ui->statusbar->showMessage("White turn", 0);
connect(board, SIGNAL(turnComplete(turn)), this, SLOT(takeTurnInfo(turn)));
board->Show();
}
void GameWindow::takeMessage(QString message)
{
this->ui->statusbar->showMessage(message, 0);
}
void GameWindow::takeTurnInfo(turn info)
{
this->ui->listWidget->addItem(QString(QString::number(info.start.x()) + "x" + QString::number(info.start.y()) + "; Weight: " + QString::number(info.weight)));
}
GameWindow::~GameWindow()
{
delete ui;
delete board;
}