2019-07-28 23:37:40 +03:00
|
|
|
#ifndef USERVIEW_H
|
|
|
|
#define USERVIEW_H
|
|
|
|
|
|
|
|
#include "playerclientdata.h"
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
class UserView : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
Q_PROPERTY(QString name READ name NOTIFY sourceChanged)
|
|
|
|
Q_PROPERTY(QString gmail READ gmail NOTIFY sourceChanged)
|
|
|
|
Q_PROPERTY(int money READ money NOTIFY sourceChanged)
|
|
|
|
Q_PROPERTY(int record READ record NOTIFY sourceChanged)
|
|
|
|
Q_PROPERTY(int avgRecord READ avgRecord NOTIFY sourceChanged)
|
|
|
|
Q_PROPERTY(int cureentSnake READ cureentSnake NOTIFY sourceChanged)
|
|
|
|
Q_PROPERTY(int id READ id NOTIFY sourceChanged)
|
2019-08-08 19:11:17 +03:00
|
|
|
Q_PROPERTY(bool offline READ offline NOTIFY offlineChanged)
|
2019-07-28 23:37:40 +03:00
|
|
|
|
|
|
|
private:
|
2019-08-09 21:20:33 +03:00
|
|
|
QSharedPointer<PlayerClientData> _source = nullptr;
|
2019-07-28 23:37:40 +03:00
|
|
|
|
2019-08-08 19:11:17 +03:00
|
|
|
bool _offline = false;
|
|
|
|
|
2019-07-28 23:37:40 +03:00
|
|
|
public:
|
|
|
|
explicit UserView(QObject *parent = nullptr);
|
|
|
|
|
|
|
|
QString name() const;
|
|
|
|
QString gmail() const;
|
|
|
|
int money() const;
|
|
|
|
int record() const;
|
|
|
|
int avgRecord() const;
|
|
|
|
int cureentSnake() const;
|
|
|
|
int id() const;
|
|
|
|
|
|
|
|
const PlayerClientData *getSource() const;
|
2019-08-08 19:11:17 +03:00
|
|
|
bool offline() const;
|
|
|
|
void setOffline(bool offline);
|
2019-07-28 23:37:40 +03:00
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
void sourceChanged();
|
|
|
|
|
2019-08-08 19:11:17 +03:00
|
|
|
void offlineChanged(bool offline);
|
|
|
|
|
2019-07-28 23:37:40 +03:00
|
|
|
public slots:
|
2019-08-09 21:20:33 +03:00
|
|
|
void setSource(QSharedPointer<PlayerClientData> data);
|
|
|
|
|
2019-07-28 23:37:40 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // USERVIEW_H
|