UnlockManager::UnlockManager() { // The global variable 'unlock_manager' is needed in the challenges, // but it's not set yet - so we define it here (and it gets re-assign // in main). unlock_manager = this; m_locked_sound = sfx_manager->createSoundSource("locked"); // Read challenges from .../data/challenges // ---------------------------------------- std::set<std::string> result; std::string challenge_dir = file_manager->getAsset(FileManager::CHALLENGE, ""); file_manager->listFiles(result, challenge_dir); for(std::set<std::string>::iterator i = result.begin(); i != result.end() ; i++) { if (StringUtils::hasSuffix(*i, ".challenge")) addChallenge(file_manager->getAsset("challenges/"+*i)); } // for i // Read challenges from .../data/tracks/* // -------------------------------------- const std::vector<std::string> *all_track_dirs = track_manager->getAllTrackDirs(); readAllChallengesInDirs(all_track_dirs); // Read challenges from .../data/karts/* // -------------------------------------- const std::vector<std::string> *all_kart_dirs = kart_properties_manager->getAllKartDirs(); readAllChallengesInDirs(all_kart_dirs); // Hard coded challenges can be added here. } // UnlockManager
static void CG_ParseChallenge( void ) { addChallenge(atoi( CG_Argv(1) ) ); }