Definition at line 13 of file LevelLoading.h.
Public Member Functions | |
LevelLoading (RoomAccess *access) | |
void | reset () |
void | loadGame (const std::string &moves) |
Start loading mode. | |
void | loadReplay (const std::string &moves) |
Start replay mode. | |
void | togglePause () |
bool | isPaused () const |
bool | isLoading () const |
void | nextLoadAction () |
Load a few moves. |
|
Definition at line 17 of file LevelLoading.cpp. 00018 { 00019 m_access = access; 00020 reset(); 00021 }
|
|
Definition at line 33 of file LevelLoading.cpp. 00034 {
00035 return !m_loadedMoves.empty() || m_replayMode;
00036 }
|
|
Definition at line 28 of file LevelLoading.h. 00028 { return m_paused; }
|
|
Start loading mode.
Definition at line 43 of file LevelLoading.cpp. 00044 { 00045 m_loadedMoves = moves; 00046 m_loadSpeed = min(50, max(5, m_loadedMoves.size() / 150)); 00047 }
|
|
Start replay mode.
Definition at line 54 of file LevelLoading.cpp. 00055 {
00056 m_loadedMoves = moves;
00057 m_loadSpeed = 1;
00058 m_replayMode = true;
00059 }
|
|
Load a few moves.
Definition at line 66 of file LevelLoading.cpp. 00067 { 00068 if (m_paused) { 00069 return; 00070 } 00071 00072 if (m_loadedMoves.empty()) { 00073 m_access->room()->beginFall(false); 00074 m_access->room()->finishRound(false); 00075 } 00076 else { 00077 for (int i = 0; i < m_loadSpeed 00078 && !m_loadedMoves.empty(); ++i) 00079 { 00080 try { 00081 char symbol = m_loadedMoves[0]; 00082 m_loadedMoves.erase(0, 1); 00083 00084 m_access->room()->loadMove(symbol); 00085 } 00086 catch (LoadException &e) { 00087 throw LoadException(ExInfo(e.info()) 00088 .addInfo("remain", m_loadedMoves)); 00089 } 00090 } 00091 } 00092 }
|
|
Definition at line 24 of file LevelLoading.cpp. 00025 { 00026 m_paused = false; 00027 m_replayMode = false; 00028 m_loadSpeed = 1; 00029 m_loadedMoves = ""; 00030 }
|
|
Definition at line 27 of file LevelLoading.h. 00027 { m_paused = !m_paused; }
|