1 /* ColorCode, a free MasterMind clone with built in solver 2 * Copyright (C) 2009 Dirk Laebisch 3 * http://www.laebisch.com/ 4 * 5 * ColorCode 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 * ColorCode 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 ColorCode. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #ifndef CCGAME_H 20 #define CCGAME_H 21 22 #include <QtCore> 23 #include <iostream> 24 #include "colorcode.h" 25 26 class CCGame 27 { 28 public: 29 CCGame(); 30 CCGame(const QString &str); 31 CCGame(const QString &unm, const uint t, const int sc, const uint gameno, const int gcnt, const int hcnt, const uint dur, const int gmode, const int ccnt, const int pcnt, const int d); 32 33 bool operator==(const CCGame &other) const; 34 bool operator!=(const CCGame &other) const; 35 36 uint mTime; 37 int mScore; 38 39 uint mGameNo; 40 int mGuessCnt; 41 int mHintCnt; 42 uint mDuration; 43 44 int mGameMode; 45 int mColorCnt; 46 int mPegCnt; 47 int mDoubles; 48 49 QString GetUserName() const; 50 void SetUserName(QString unm); 51 uint GetTime() const; 52 int GetScore() const; 53 QString GetDateTimeStr() const; 54 QString GetDatePartStr() const; 55 QString GetTimePartStr() const; 56 QString GetCmbStr() const; 57 58 void Anonymize(); 59 QString ToString() const; 60 bool HasSameSettings(const CCGame &g) const; 61 bool IsValidGame() const; 62 63 private: 64 QString mUserNm; 65 66 }; 67 68 #endif // CCGAME_H 69