Rev 19 | Rev 30 | 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> |
||
| 23 | muzer | 11 | #include <cmath> |
| 1 | muzer | 12 | |
| 13 | using namespace std; |
||
| 14 | |||
| 15 | class Bike : public QThread |
||
| 16 | { |
||
| 9 | muzer | 17 | Q_OBJECT |
| 1 | muzer | 18 | |
| 9 | muzer | 19 | public: |
| 20 | Bike(QTcpSocket *sock, int i); |
||
| 15 | muzer | 21 | void draw(QPainter *painter,QList<Bike *> bikes); |
| 9 | muzer | 22 | void run(QList<Bike *> bikes); |
| 15 | muzer | 23 | bool hasCollided(QList<Bike *> bikes); |
| 9 | muzer | 24 | void reset(); |
| 25 | bool isReady; |
||
| 26 | bool dead; |
||
| 27 | bool show; |
||
| 28 | bool hadGo; |
||
| 29 | float x; |
||
| 30 | float y; |
||
| 31 | QString name; |
||
| 32 | int angle; |
||
| 33 | QList<QPoint> linePoints; |
||
| 34 | int id; |
||
| 35 | bool isDisconnected; |
||
| 36 | bool hasHadGo; |
||
| 37 | QColor colour; |
||
| 38 | bool collided; |
||
| 19 | muzer | 39 | float abpool; |
| 1 | muzer | 40 | |
| 9 | muzer | 41 | private: |
| 42 | QTcpSocket *socket; |
||
| 43 | float velocity; |
||
| 1 | muzer | 44 | |
| 45 | private slots: |
||
| 9 | muzer | 46 | void readyRead(); |
| 47 | void disconnected(); |
||
| 1 | muzer | 48 | }; |
| 49 | |||
| 50 | #endif // BIKE_H |