CDefObjInfoHandler.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef COBJINFOECTHANDLER_H
  2. #define COBJINFOECTHANDLER_H
  3. #include <vector>
  4. #include <map>
  5. #include "../global.h"
  6. class CDefHandler;
  7. class CLodHandler;
  8. class DLL_EXPORT CGDefInfo
  9. {
  10. public:
  11. std::string name;
  12. unsigned char visitMap[6];
  13. unsigned char blockMap[6];
  14. unsigned char visitDir; //directions from which object can be entered, format same as for moveDir in CGHeroInstance(but 0 - 7)
  15. int id, subid; //of object described by this defInfo
  16. int terrainAllowed, //on which terrain it is possible to place object
  17. terrainMenu; //in which menus in map editor object will be showed
  18. int width, height; //tiles
  19. int type; //(0- ground, 1- towns, 2-creatures, 3- heroes, 4-artifacts, 5- resources)
  20. CDefHandler * handler;
  21. int printPriority;
  22. bool isVisitable();
  23. bool operator<(const CGDefInfo& por)
  24. {
  25. if(id!=por.id)
  26. return id<por.id;
  27. else
  28. return subid<por.subid;
  29. }
  30. CGDefInfo();
  31. };
  32. class DLL_EXPORT CDefObjInfoHandler
  33. {
  34. public:
  35. std::map<int,std::map<int,CGDefInfo*> > gobjs;
  36. std::map<int,CGDefInfo*> castles;
  37. //std::vector<DefObjInfo> objs;
  38. void load();
  39. };
  40. #endif //COBJINFOECTHANDLER_H