-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInGame.h
50 lines (37 loc) · 959 Bytes
/
InGame.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
41
42
43
44
45
46
47
48
49
50
#pragma once
#include <QLabel>
#include <QVBoxLayout>
#include <QWidget>
#include <QTimer>
#include <QPixmap>
#include <QPalette>
#include <QBrush>
class InGame : public QWidget {
Q_OBJECT
public:
explicit InGame(QWidget* parent = nullptr);
void updateScode() const;
void updatePos(const std::string& x, const std::string &y) const;
void updateSpeed(const std::string& speed) const;
void updateAngle(const std::string& angle) const;
void updateTime();
void showEvent(QShowEvent* event) override;
void stopTimer() const;
void setScore(int score);
void addScore(int score);
signals:
void askTCPServer(const std::string& message);
private:
QLabel* pts;
QLabel* x;
QLabel* y;
QLabel* time;
QLabel* speed;
QLabel* angle;
QVBoxLayout* mainLayout;
QHBoxLayout* posAndTimeLayout;
QVBoxLayout* posLayout;
QTimer* timer;
int timeCounter = 0;
int score = 0;
};