Subversion Repositories QTron

Rev

Rev 39 | 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
 
35 muzer 17
class Bike : public QObject
1 muzer 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);
36 muzer 26
    void setText(QString text);
9 muzer 27
    void reset();
40 muzer 28
    void greet();
9 muzer 29
    bool isReady;
30
    bool dead;
31
    bool show;
32
    bool hadGo;
40 muzer 33
    int x;
34
    int y;
9 muzer 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;
36 muzer 45
    float velocity;
46
    float speed;
9 muzer 47
    QTcpSocket *socket;
36 muzer 48
    bool haveSentAlready;
40 muzer 49
    bool couldReadLine;
1 muzer 50
 
31 tom 51
private slots:
36 muzer 52
    void disconnected();
9 muzer 53
    void readyRead();
31 tom 54
 
55
signals:
36 muzer 56
    void chat(QString name, QString message);
1 muzer 57
};
58
 
59
#endif // BIKE_H