Subversion Repositories QTron

Rev

Rev 35 | 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();
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;
36 muzer 44
    float velocity;
45
    float speed;
9 muzer 46
    QTcpSocket *socket;
36 muzer 47
    bool haveSentAlready;
1 muzer 48
 
31 tom 49
private slots:
36 muzer 50
    void disconnected();
9 muzer 51
    void readyRead();
31 tom 52
 
53
signals:
36 muzer 54
    void chat(QString name, QString message);
1 muzer 55
};
56
 
57
#endif // BIKE_H