Subversion Repositories QTron

Rev

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