Definition at line 13 of file LevelCountDown.h.
Public Member Functions | |
LevelCountDown (const RoomAccess *access) | |
Prepare countdown. | |
void | fillStatus (LevelStatus *status) |
void | reset () |
Resets counter. | |
bool | countDown (const CountAdvisor *advisor) |
Countdown to zero. | |
bool | isFinishedEnough () const |
bool | isWrongEnough () const |
void | saveSolution () |
Write best solution to the file. | |
GameState * | createNextState () |
Creates next state or returns NULL. |
|
Prepare countdown.
Definition at line 22 of file LevelCountDown.cpp. 00023 { 00024 m_countdown = -1; 00025 m_access = access; 00026 m_levelStatus = NULL; 00027 }
|
|
Countdown to zero.
Definition at line 49 of file LevelCountDown.cpp. 00050 { 00051 bool result = false; 00052 if (m_countdown < 0) { 00053 setCountDown(advisor); 00054 } 00055 else if (m_countdown > 0) { 00056 m_countdown--; 00057 } 00058 else { 00059 result = true; 00060 } 00061 return result; 00062 }
|
|
Creates next state or returns NULL.
Definition at line 109 of file LevelCountDown.cpp. 00110 { 00111 return m_levelStatus->createPoster(); 00112 }
|
|
Definition at line 22 of file LevelCountDown.h. 00022 { m_levelStatus = status; }
|
|
Definition at line 79 of file LevelCountDown.cpp. 00080 { 00081 return m_countdown == 0 && m_access->const_room()->isSolved(); 00082 }
|
|
Definition at line 85 of file LevelCountDown.cpp. 00086 { 00087 return m_countdown == 0 && m_access->const_room()->cannotMove() && 00088 !m_access->const_room()->isSolved(); 00089 }
|
|
Resets counter.
Definition at line 34 of file LevelCountDown.cpp. 00035 { 00036 if (NULL == m_levelStatus) { 00037 throw LogicException(ExInfo("level status is NULL")); 00038 } 00039 m_levelStatus->setRunning(true); 00040 m_countdown = -1; 00041 }
|
|
Write best solution to the file. Save moves and models state. Definition at line 96 of file LevelCountDown.cpp. 00097 { 00098 m_levelStatus->setComplete(); 00099 std::string current_moves = 00100 m_access->const_room()->stepCounter()->getMoves(); 00101 m_levelStatus->writeSolvedMoves(current_moves); 00102 }
|