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