// This file generated by libqtelegram-code-generator.
// You can download it from: https://github.com/Aseman-Land/libqtelegram-code-generator
// DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

#ifndef LQTG_TYPE_HIGHSCORE
#define LQTG_TYPE_HIGHSCORE

#include "telegramtypeobject.h"

#include <QMetaType>
#include <QVariant>
#include "../coretypes.h"

#include <QDataStream>

#include <QtGlobal>

class LIBQTELEGRAMSHARED_EXPORT HighScore : public TelegramTypeObject
{
public:
    enum HighScoreClassType {
        typeHighScore = 0x58fffcd0
    };

    HighScore(HighScoreClassType classType = typeHighScore, InboundPkt *in = 0);
    HighScore(InboundPkt *in);
    HighScore(const Null&);
    HighScore(const HighScore &another);
    virtual ~HighScore();

    void setPos(qint32 pos);
    qint32 pos() const;

    void setScore(qint32 score);
    qint32 score() const;

    void setUserId(qint32 userId);
    qint32 userId() const;

    void setClassType(HighScoreClassType classType);
    HighScoreClassType classType() const;

    bool fetch(InboundPkt *in);
    bool push(OutboundPkt *out) const;

    QMap<QString, QVariant> toMap() const;
    static HighScore fromMap(const QMap<QString, QVariant> &map);
    static HighScore fromJson(const QString &json);

    bool operator ==(const HighScore &b) const;
    HighScore &operator =(const HighScore &b);

    bool operator==(bool stt) const { return isNull() != stt; }
    bool operator!=(bool stt) const { return !operator ==(stt); }

    QByteArray getHash(QCryptographicHash::Algorithm alg = QCryptographicHash::Md5) const;

private:
    qint32 m_pos;
    qint32 m_score;
    qint32 m_userId;
    HighScoreClassType m_classType;
};

Q_DECLARE_METATYPE(HighScore)

QDataStream LIBQTELEGRAMSHARED_EXPORT &operator<<(QDataStream &stream, const HighScore &item);
QDataStream LIBQTELEGRAMSHARED_EXPORT &operator>>(QDataStream &stream, HighScore &item);

QDebug LIBQTELEGRAMSHARED_EXPORT operator<<(QDebug debug,  const HighScore &item);

#endif // LQTG_TYPE_HIGHSCORE
