Subversion Repositories QTron

Rev

Rev 30 | Rev 32 | 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>
#include <cmath>

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 setText(QString text);
    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;
    float abpool;

private:
    QTcpSocket *socket;
        float velocity;

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

signals:
        void chat(QString name, QString message);
};

#endif // BIKE_H