Subversion Repositories QTron

Rev

Rev 35 | Rev 39 | 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>
#include <time.h>
#include <stdio.h>

using namespace std;

class Bike : public QObject
{
    Q_OBJECT

public:
    Bike(QTcpSocket *sock, int i);
    void draw(QPainter *painter,QList<Bike *> bikes);
    void run();
    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;
    QList<Bike *> bikes;
    QColor colour;
    bool collided;
    float abpool;
    float velocity;
    float speed;
    QTcpSocket *socket;
    bool haveSentAlready;

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

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

#endif // BIKE_H