Subversion Repositories QTron

Rev

Rev 9 | Rev 19 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#ifndef BIKE_H
#define BIKE_H

#include <QObject>
#include <QPainter>
#include <QTcpSocket>
#include <QLine>
#include <iostream>
#include <QHostAddress>
#include <QThread>

using namespace std;

class Bike : public QThread
{
    Q_OBJECT

public:
    Bike(QTcpSocket *sock, int i);
    void draw(QPainter *painter,QList<Bike *> bikes);
    void run(QList<Bike *> bikes);
    bool hasCollided(QList<Bike *> bikes);
    void reset();
    bool isReady;
    bool dead;
    bool show;
    bool hadGo;
    float x;
    float y;
    QString name;
    int angle;
    QList<QPoint> linePoints;
    int id;
    bool isDisconnected;
    bool hasHadGo;
    QColor colour;
    bool collided;

private:
    QTcpSocket *socket;
    float velocity;

        private slots:
    void readyRead();
    void disconnected();
};

#endif // BIKE_H