-
Notifications
You must be signed in to change notification settings - Fork 1
/
game.h
40 lines (31 loc) · 815 Bytes
/
game.h
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
#ifndef GAME_H
#define GAME_H
#include "ship.h"
#include "status.h"
#include <QString>
#include <QChar>
class Game
{
private:
int steps; //number of steps
QString user; //username
QString areaBoard;
QList<Ship> shipsList; //list of user's ships
int boardNumbers[9][9]; //number of fields occupied by ships around the selected position
public:
Game();
Game(QString user);
QString getUser();
Status getStatus();
int getSteps();
QString getBoard();
void boardGenerating();
Status shot(QString position);
QList<Ship> getShips();
void showGame();
void addSteps();
void setShips(QList<Ship> list);
friend QDataStream &operator<<(QDataStream& out, Game& game);
friend QDataStream &operator>>(QDataStream& in, Game *game);
};
#endif // GAME_H