#ifndef CLIENT_H
#define CLIENT_H

#include <QString>
#include <QTcpSocket>

class Client
{

public:
    Client(QString name, QString address, QString port,QObject *parent = nullptr):
        login(""),
        ready(false)
    {
        this->name = name;
        this->address = address;
        this->port = port;
        this->fullName = "Name: " + name + " IP: " + address + " port : " + port + " login: " + login;
    };
    ~Client();

public:
    QString getFullName()
    {
        return fullName;
    };

    void setLogin(QString login)
    {
        this->login = login;
        fullName = "Name: " + name + " IP: " + address + " port : " + port + " login: " + login;
    }
    QString getLogin()
    {
        return login;
    }

    QString getAddress()
    {
        return address;
    }
    QString getPort()
    {
        return port;
    }

    bool getReady()
    {
        return ready;
    }
    void setReady(bool ready)
    {
        this->ready = ready;
    }
    void setUnity(bool flag){
        isUnity = flag;
    }
    bool getIsUnity()
    {
        return isUnity;
    }
    void changePackageResponse()
    {
        isUnity = !isUnity;
    }
    bool operator == (Client* right){
        return  this->address == right->address;
    }


private:
    QString name;
    QString address;
    QString port;
    QString fullName;

    QString login;
    bool ready;
    bool isUnity = false;
};

#endif // CLIENT_H
