Rev 15 | 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> | 
        ||
| 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);  | 
        ||
| 15 | muzer | 20 | void draw(QPainter *painter,QList<Bike *> bikes);  | 
        
| 9 | muzer | 21 | void run(QList<Bike *> bikes);  | 
        
| 15 | muzer | 22 | bool hasCollided(QList<Bike *> bikes);  | 
        
| 9 | muzer | 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;  | 
        ||
| 19 | muzer | 38 | float abpool;  | 
        
| 1 | muzer | 39 | |
| 9 | muzer | 40 | private:  | 
        
| 41 | QTcpSocket *socket;  | 
        ||
| 42 | float velocity;  | 
        ||
| 1 | muzer | 43 | |
| 44 | private slots:  | 
        ||
| 9 | muzer | 45 | void readyRead();  | 
        
| 46 | void disconnected();  | 
        ||
| 1 | muzer | 47 | };  | 
        
| 48 | |||
| 49 | #endif // BIKE_H |