Initial commit

This commit is contained in:
2024-11-30 09:36:15 +02:00
commit 289ad112e3
19 changed files with 1427 additions and 0 deletions

30
qtictactoegame.h Normal file
View File

@@ -0,0 +1,30 @@
#ifndef QTICTACTOEGAME_H
#define QTICTACTOEGAME_H
#include <QObject>
class QTicTacToeGame : public QObject
{
Q_OBJECT
public:
explicit QTicTacToeGame(int size = 3, int countToWin = 3, QObject *parent = 0);
bool put(int x, int y, int player);
int getPlayer(int x, int y);
Q_INVOKABLE int getSize();
void clear();
private:
int **board;
int size, countToWin, aviableCells;
bool checkFromPoint(int x, int y);
signals:
void gameOver(int player);
void itemPuted(int x, int y, int player);
public slots:
};
#endif // QTICTACTOEGAME_H