00001 #ifndef HEADER_LEVELSTATUS_H
00002 #define HEADER_LEVELSTATUS_H
00003
00004 class GameState;
00005
00006 #include "Scripter.h"
00007
00008
00009
00010
00011 class LevelStatus : public Scripter {
00012 private:
00013 bool m_complete;
00014 bool m_wasRunning;
00015 std::string m_codename;
00016 std::string m_poster;
00017 std::string m_savedMoves;
00018 int m_bestMoves;
00019 std::string m_bestAuthor;
00020 private:
00021 std::string getSolutionFilename() const;
00022 public:
00023 LevelStatus();
00024 void prepareRun(const std::string &codename,
00025 const std::string &poster,
00026 int bestMoves, const std::string &bestAuthor);
00027 GameState *createPoster() const;
00028 int getBestMoves() const { return m_bestMoves; }
00029 std::string getBestAuthor() const { return m_bestAuthor; }
00030 int compareToBest();
00031
00032 void setComplete() { m_complete = true; }
00033 bool isComplete() const { return m_complete; }
00034 void setRunning(bool value) { m_wasRunning = value; }
00035 bool wasRunning() const { return m_wasRunning; }
00036
00037 void readMoves(const std::string &moves);
00038 std::string readSolvedMoves();
00039 void writeSolvedMoves(const std::string &moves);
00040
00041 static std::string getSolutionFilename(const std::string &codename);
00042 };
00043
00044 #endif