1 /* Pushover 2 * 3 * Pushover is the legal property of its developers, whose 4 * names are listed in the COPYRIGHT file, which is included 5 * within the source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA 20 */ 21 22 #ifndef __LEVELSET_H__ 23 #define __LEVELSET_H__ 24 25 #include <string> 26 #include <vector> 27 #include <map> 28 29 class levelData_c; 30 class textsections_c; 31 32 class levelset_c { 33 34 private: 35 36 std::string name; 37 unsigned int priority; 38 std::vector<std::string> levelNames; 39 std::map<std::string, std::string> checksums; 40 std::map<std::string, std::string> checksumsNoTime; 41 std::map<std::string, textsections_c> levels; 42 43 public: 44 45 levelset_c(const std::string & path, const std::string & userString); getName(void)46 const std::string getName(void) const { return name; } getPriority(void)47 const unsigned int getPriority(void) const { return priority; } 48 getLevelNames(void)49 const std::vector<std::string> & getLevelNames(void) const { return levelNames; } 50 const std::string & getChecksum(const std::string & levelName) const; 51 const std::string & getChecksumNoTime(const std::string & levelName) const; 52 void loadLevel(levelData_c & level, const std::string & levelName, const std::string & userString) const; 53 }; 54 55 class levelsetList_c { 56 57 private: 58 59 std::map<std::string, levelset_c> levelsets; 60 std::vector<std::string> levelsetNames; 61 std::vector<std::pair<unsigned int, std::string> > sortHelper; 62 63 public: 64 levelsetList_c()65 levelsetList_c() {}; 66 void load(const std::string & path, const std::string & userString); getLevelsetNames(void)67 const std::vector<std::string> & getLevelsetNames(void) const { return levelsetNames; } 68 const levelset_c & getLevelset(const std::string & levelsetName) const; 69 }; 70 71 #endif 72