Subversion Repositories QTron

Rev

Rev 31 | Rev 34 | 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);
30 tom 24
        void setText(QString text);
9 muzer 25
    void reset();
26
    bool isReady;
27
    bool dead;
28
    bool show;
29
    bool hadGo;
30
    float x;
31
    float y;
32
    QString name;
33
    int angle;
34
    QList<QPoint> linePoints;
35
    int id;
36
    bool isDisconnected;
37
    bool hasHadGo;
38
    QColor colour;
39
    bool collided;
19 muzer 40
    float abpool;
32 tom 41
        float velocity;
42
        float speed;
1 muzer 43
 
9 muzer 44
private:
45
    QTcpSocket *socket;
1 muzer 46
 
31 tom 47
private slots:
9 muzer 48
    void readyRead();
49
    void disconnected();
31 tom 50
 
51
signals:
52
        void chat(QString name, QString message);
1 muzer 53
};
54
 
55
#endif // BIKE_H