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