void GameData::GameOver(bool iswin) { setGameResult(iswin); if (m_Playing) { m_Playing = false; if (!iswin) { UIController::getInstance()->getMainUILayer()->showBuyFuHuoWidget(); } else { //如果是胜利,那么主飞机飞出屏幕 auto pl = GameData::getInstance()->getMainPlane(); if (pl) { auto mianpl = (MainPlane*)pl; mianpl->FlyUp(); } } } }
void Menu::parseCommand(string cmd) { if (cmd == "help") showHelp(); else if (cmd == "add_player") addPlayer(); else if (cmd == "del_player") delPlayer(); else if (cmd == "modify_player") modifyPlayer(); else if (cmd == "show_player") showPlayer(); else if (cmd == "show_all_players") showAllPlayers(); else if (cmd == "search_player") searchPlayer(); else if (cmd == "add_game") addGame(); else if (cmd == "del_game") delGame(); else if (cmd == "modify_game") modifyGame(); else if (cmd == "set_game_res") setGameResult(); else if (cmd == "show_game") showGame(); else if (cmd == "show_all_games") showAllGames(); else if (cmd == "sort_games_by_date") sortGamesByDate(); else if (cmd == "sort_games_by_res") sortGamesByResult(); else if (cmd == "search_game_by_date") searchGameByDate(); else if (cmd == "search_game_by_opponent") searchGameByOpponent(); else if (cmd == "add_stadium") addStadium(); else if (cmd == "del_stadium") delStadium(); else if (cmd == "modify_stadium") modifyStadium(); else if (cmd == "show_stadium") showStadium(); else if (cmd == "show_all_stadiums") showAllStadiums(); else if (cmd == "search_stadium") searchStadium(); else if (cmd == "save_db") saveDbToFile(); else if (cmd == "load_db") loadDbFromFile(); else if (cmd == "") {} else if (cmd == "exit") exit(0); else error(ERR_INVALID_CMD); }