-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchessgame.h
More file actions
50 lines (43 loc) · 1.44 KB
/
chessgame.h
File metadata and controls
50 lines (43 loc) · 1.44 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef CHESSGAME_H
#define CHESSGAME_H
#include "chessboard.h"
#include "chesspanel.h"
#include "chesssettings.h"
#include <QMainWindow>
#include <QGridLayout>
#include <QVBoxLayout>
#include <QMenuBar>
#include <QMenu>
#include <QMessageBox>
#include <QStatusBar>
#include <QApplication>
#include <QFileDialog>
class chessGame : public QMainWindow
{
Q_OBJECT
public:
chessGame(QWidget *parent = 0);
bool close_window(); //!<Zamyka grę
~chessGame();
public slots:
void new_game(); //!<Tworzy nową sesję gry.
void save_game(); //!<Zapisuje obecny stan gry do pliku
void saveAs_game(); //!<Zapisuje obecny stan gry do nowego pliku
void open_game(); //!<Otwiera i odczytuje stan gry z pliku
void open_settings(); //!<Otwiera okno ustawień
void about_qt(); //!<Otwiera okno "About Qt"
void about_game(); //!<Otwiera okno "O grze"
void game_over(int player); //!<Kończy aktualną grę i wyświetla komunikat o zwycięstwie.
void setSaved(bool save);//!<Ustawia stan gry
void close_game(); //!<Próbuje zamknąć grę - wywołuje close_windows()
void setNotSaved(); //!<Ustawia stan gry na niezapisany
protected:
void closeEvent(QCloseEvent *event); ///Definiuje działanie w przypadku zamknięcia okna.
private:
void createMenus();
QString currentFile;
bool saved;
chessBoard *chessboard;
chessPanel *panel;
};
#endif // CHESSGAME_H