Rev 1 | Rev 9 | Go to most recent revision | Details | Compare with Previous | 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; |
||
| 6 | muzer | 35 | QColor colour; |
| 1 | muzer | 36 | |
| 37 | private: |
||
| 38 | QTcpSocket *socket; |
||
| 39 | float velocity; |
||
| 40 | |||
| 41 | private slots: |
||
| 42 | void readyRead(); |
||
| 43 | void disconnected(); |
||
| 44 | }; |
||
| 45 | |||
| 46 | #endif // BIKE_H |