1 #ifndef HEADER_WORLDBRANCH_H 2 #define HEADER_WORLDBRANCH_H 3 4 class Path; 5 class LevelNode; 6 class LevelDesc; 7 class ResDialogPack; 8 9 #include "Scripter.h" 10 11 #include <string> 12 13 /** 14 * Can read graph of level nodes. 15 */ 16 class WorldBranch : public Scripter { 17 private: 18 LevelNode *m_root; 19 LevelNode *m_ending; 20 ResDialogPack *m_outPack; 21 private: 22 bool wasSolved(const std::string &codename); 23 void prepareNode(LevelNode *node, bool hidden); 24 void insertNode(const std::string &parent, LevelNode *new_node); 25 public: 26 WorldBranch(LevelNode *root); 27 28 LevelNode* parseMap(const Path &datafile, LevelNode **outEnding, 29 ResDialogPack *des); 30 31 void addDesc(const std::string &codename, LevelDesc *desc); 32 void addNode(const std::string &parent, LevelNode *new_node, 33 bool hidden); 34 void setEnding(LevelNode *new_node); 35 void bestSolution(const std::string &codename, int moves, 36 const std::string &author); 37 }; 38 39 #endif 40