CGeneralTextHandler.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef __CGENERALTEXTHANDLER_H__
  2. #define __CGENERALTEXTHANDLER_H__
  3. #include "../global.h"
  4. #include <string>
  5. #include <vector>
  6. /*
  7. * CGeneralTextHandler.h, part of VCMI engine
  8. *
  9. * Authors: listed in file AUTHORS in main folder
  10. *
  11. * License: GNU General Public License v2.0 or later
  12. * Full text of license available in license.txt file, in main folder
  13. *
  14. */
  15. DLL_EXPORT void loadToIt(std::string &dest, std::string &src, int &iter, int mode);
  16. std::string readTo(std::string &in, int &it, char end);
  17. class DLL_EXPORT CGeneralTextHandler //Handles general texts
  18. {
  19. public:
  20. class HeroTexts
  21. {
  22. public:
  23. std::string bonusName, shortBonus, longBonus; //for special abilities
  24. std::string biography; //biography, of course
  25. };
  26. std::vector<HeroTexts> hTxts;
  27. std::vector<std::string> allTexts;
  28. std::vector<std::string> arraytxt;
  29. std::vector<std::string> primarySkillNames;
  30. std::vector<std::string> jktexts;
  31. std::vector<std::string> heroscrn;
  32. //artifacts
  33. std::vector<std::string> artifEvents;
  34. std::vector<std::string> artifNames;
  35. std::vector<std::string> artifDescriptions;
  36. //towns
  37. std::vector<std::string> tcommands, hcommands; //texts for town screen and town hall screen
  38. std::vector<std::string> tavernInfo;
  39. std::vector<std::vector<std::string> > townNames; //[type id] => vec of names of instances
  40. std::vector<std::string> townTypes; //castle, rampart, tower, etc
  41. std::map<int, std::map<int, std::pair<std::string, std::string> > > buildings; //map[town id][building id] => pair<name, description>
  42. std::vector<std::pair<std::string,std::string> > zelp;
  43. std::string lossCondtions[4];
  44. std::string victoryConditions[14];
  45. //objects
  46. std::vector<std::string> names; //vector of objects; i-th object in vector has subnumber i
  47. std::vector<std::string> creGens; //names of creatures' generators
  48. std::vector<std::string> creGens4; //names of multiple creatures' generators
  49. std::vector<std::string> advobtxt;
  50. std::vector<std::string> xtrainfo;
  51. std::vector<std::string> restypes;
  52. std::vector<std::string> randsign;
  53. std::vector<std::pair<std::string,std::string> > mines; //first - name; second - event description
  54. //sec skills
  55. std::vector <std::string> skillName;
  56. std::vector <std::vector <std::string> > skillInfoTexts; //[id][level] : level 0 - basic; 2 - advanced
  57. std::vector<std::string> levels;
  58. std::string getTitle(std::string text);
  59. std::string getDescr(std::string text);
  60. void load();
  61. CGeneralTextHandler();
  62. };
  63. #endif // __CGENERALTEXTHANDLER_H__