| 1 |
#ifndef HEADER_LEVELSTATUS_H |
| 2 |
#define HEADER_LEVELSTATUS_H |
| 3 |
|
| 4 |
class GameState; |
| 5 |
|
| 6 |
#include "Scripter.h" |
| 7 |
|
| 8 |
/** |
| 9 |
* Status of level after a game. |
| 10 |
*/ |
| 11 |
class LevelStatus : public Scripter { |
| 12 |
private: |
| 13 |
bool m_complete; |
| 14 |
bool m_wasRunning; |
| 15 |
std::string m_codename; |
| 16 |
std::string m_poster; |
| 17 |
std::string m_savedMoves; |
| 18 |
int m_bestMoves; |
| 19 |
std::string m_bestAuthor; |
| 20 |
private: |
| 21 |
std::string getSolutionFilename() const; |
| 22 |
public: |
| 23 |
LevelStatus(); |
| 24 |
void prepareRun(const std::string &codename, |
| 25 |
const std::string &poster, |
| 26 |
int bestMoves, const std::string &bestAuthor); |
| 27 |
GameState *createPoster() const; |
| 28 |
int getBestMoves() const { return m_bestMoves; } |
| 29 |
std::string getBestAuthor() const { return m_bestAuthor; } |
| 30 |
int compareToBest(); |
| 31 |
|
| 32 |
void setComplete() { m_complete = true; } |
| 33 |
bool isComplete() const { return m_complete; } |
| 34 |
void setRunning(bool value) { m_wasRunning = value; } |
| 35 |
bool wasRunning() const { return m_wasRunning; } |
| 36 |
|
| 37 |
void readMoves(const std::string &moves); |
| 38 |
std::string readSolvedMoves(); |
| 39 |
void writeSolvedMoves(const std::string &moves); |
| 40 |
|
| 41 |
static std::string getSolutionFilename(const std::string &codename); |
| 42 |
}; |
| 43 |
|
| 44 |
#endif |