Skip to content

Instantly share code, notes, and snippets.

Created October 21, 2016 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/16198dd29f39b58bfbce41a07b2def55 to your computer and use it in GitHub Desktop.
Save anonymous/16198dd29f39b58bfbce41a07b2def55 to your computer and use it in GitHub Desktop.
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
// Ходы Очки Данные ячеек
int getMoveValue(); int getScoreValue(); int getGameData(int x, int y);
int setMoveValue(int i); int setScoreValue(int i); int setGameData(int x, int y, int val);
int moveValuePlus(); int scoreValuePlus(int i);
// Управление
void moveUp(); void moveDown();
void moveLeft(); void moveRight();
void generateCell(bool boolean);
// Победитель
bool setWinner(bool value); bool getWinner();
void Winner();
// Статус игры
bool setGameStatus(bool status); bool getGameStatus();
void gameOver();
private:
Ui::MainWindow *ui;
// +---------------+
// | gameData |
// +---------------+
// | 0 | 0 | 0 | 0 |
// | 0 | 0 | 0 | 0 |
// | 0 | 0 | 0 | 0 |
// | 0 | 0 | 0 | 0 |
// +---------------+
// Шаги Очки Ячейки игрового поля
int moves; int scores; int gameData[4][4];
bool gameStatus;
bool winner;
protected:
void keyPressEvent(QKeyEvent *e);
public slots:
void About();
void NewGame();
void Exit();
};
#endif // MAINWINDOW_H
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment