00001 #ifndef HEADER_WORLDBRANCH_H 00002 #define HEADER_WORLDBRANCH_H 00003 00004 class Path; 00005 class LevelNode; 00006 class LevelDesc; 00007 class ResDialogPack; 00008 00009 #include "Scripter.h" 00010 00011 #include <string> 00012 00013 /** 00014 * Can read graph of level nodes. 00015 */ 00016 class WorldBranch : public Scripter { 00017 private: 00018 LevelNode *m_root; 00019 LevelNode *m_ending; 00020 ResDialogPack *m_outPack; 00021 private: 00022 bool wasSolved(const std::string &codename); 00023 void prepareNode(LevelNode *node, bool hidden); 00024 void insertNode(const std::string &parent, LevelNode *new_node); 00025 public: 00026 WorldBranch(LevelNode *root); 00027 00028 LevelNode* parseMap(const Path &datafile, LevelNode **outEnding, 00029 ResDialogPack *des); 00030 00031 void addDesc(const std::string &codename, LevelDesc *desc); 00032 void addNode(const std::string &parent, LevelNode *new_node, 00033 bool hidden); 00034 void setEnding(LevelNode *new_node); 00035 void bestSolution(const std::string &codename, int moves, 00036 const std::string &author); 00037 }; 00038 00039 #endif