1 /***************************************************************************** 2 * LibreMines * 3 * Copyright (C) 2020-2021 Bruno Bollos Correa * 4 * * 5 * This program is free software: you can redistribute it and/or modify * 6 * it under the terms of the GNU General Public License as published by * 7 * the Free Software Foundation, either version 3 of the License, or * 8 * (at your option) any later version. * 9 * * 10 * This program is distributed in the hope that it will be useful, * 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 * GNU General Public License for more details. * 14 * * 15 * You should have received a copy of the GNU General Public License * 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. * 17 ***************************************************************************** 18 */ 19 20 21 #ifndef LIBREMINESSCORE_H 22 #define LIBREMINESSCORE_H 23 24 #include "common.h" 25 26 class LibreMinesScore 27 { 28 public: 29 LibreMinesScore(); 30 31 operator QString() const; 32 33 qint64 iTimeInNs; 34 GAME_DIFFICULTY gameDifficulty; 35 uchar width; 36 uchar heigth; 37 ushort mines; 38 bool bGameCompleted; 39 double dPercentageGameCompleted; 40 QString username; 41 42 static bool bFirstIsBetter(const LibreMinesScore& first, const LibreMinesScore& second); 43 static void sort(QList<LibreMinesScore> &l); 44 }; 45 46 QDataStream& operator<< (QDataStream& stream, const LibreMinesScore& score); 47 QDataStream& operator>> (QDataStream& stream, LibreMinesScore& score); 48 QDebug operator<<(QDebug debug, const LibreMinesScore& score); 49 50 #endif // LIBREMINESSCORE_H 51