Rev 6 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | muzer | 1 | #ifndef BIKE_H |
2 | #define BIKE_H |
||
3 | |||
4 | #include <QObject> |
||
5 | #include <QPainter> |
||
6 | #include <QTcpSocket> |
||
7 | #include <QLine> |
||
8 | #include <iostream> |
||
9 | #include <QHostAddress> |
||
10 | #include <QThread> |
||
11 | |||
12 | using namespace std; |
||
13 | |||
14 | class Bike : public QThread |
||
15 | { |
||
16 | Q_OBJECT |
||
17 | |||
18 | public: |
||
19 | Bike(QTcpSocket *sock, int i); |
||
20 | void draw(QPainter *painter); |
||
21 | void run(QList<Bike *> bikes); |
||
22 | void reset(); |
||
23 | bool isReady; |
||
24 | bool dead; |
||
25 | bool show; |
||
26 | bool hadGo; |
||
27 | float x; |
||
28 | float y; |
||
29 | QString name; |
||
30 | int angle; |
||
31 | QList<QPoint> linePoints; |
||
32 | int id; |
||
33 | bool isDisconnected; |
||
34 | bool hasHadGo; |
||
35 | |||
36 | private: |
||
37 | QTcpSocket *socket; |
||
38 | float velocity; |
||
39 | QColor colour; |
||
40 | |||
41 | private slots: |
||
42 | void readyRead(); |
||
43 | void disconnected(); |
||
44 | }; |
||
45 | |||
46 | #endif // BIKE_H |