File indexing completed on 2025-04-27 03:29:48
0001 /* 0002 SPDX-FileCopyrightText: 2005-2006 Albert Astals Cid <aacid@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef HIGHSCOREDIALOG_H 0008 #define HIGHSCOREDIALOG_H 0009 0010 #include <QDialog> 0011 0012 #include <QPair> 0013 #include <QList> 0014 0015 class QSvgRenderer; 0016 0017 class myTabWidget; 0018 0019 class highScoreDialog : private QDialog 0020 { 0021 public: 0022 highScoreDialog(QWidget *parent, QSvgRenderer *renderer); 0023 0024 void showLevel(int level); 0025 0026 myTabWidget *m_tw; 0027 }; 0028 0029 class highScoreManager : public QObject 0030 { 0031 Q_OBJECT 0032 public: 0033 highScoreManager(); 0034 ~highScoreManager() override; 0035 0036 bool scoreGoodEnough(int level, int score); 0037 void addScore(int level, int score, const QString &name); 0038 0039 QList< QPair<int, QString> > scores(int level) const; 0040 0041 Q_INVOKABLE int score(int level, int position) const; 0042 Q_INVOKABLE QString name(int level, int position) const; 0043 0044 private: 0045 void update(); 0046 0047 QList< QPair<int, QString> > m_scores[3]; 0048 }; 0049 0050 #endif