CDefObjInfoHandler.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef COBJINFOECTHANDLER_H
  2. #define COBJINFOECTHANDLER_H
  3. #include <vector>
  4. #include <map>
  5. class CDefHandler;
  6. class CGDefInfo
  7. {
  8. public:
  9. std::string name;
  10. unsigned char visitMap[6];
  11. unsigned char blockMap[6];
  12. int id, subid; //of object described by this defInfo
  13. int terrainAllowed, //on which terrain it is possible to place object
  14. terrainMenu; //in which menus in map editor object will be showed
  15. int type; //(0- ground, 1- towns, 2-creatures, 3- heroes, 4-artifacts, 5- resources)
  16. CDefHandler * handler;
  17. int printPriority;
  18. bool isVisitable();
  19. bool operator<(const CGDefInfo& por)
  20. {
  21. if(id!=por.id)
  22. return id<por.id;
  23. else
  24. return subid<por.subid;
  25. }
  26. };
  27. struct DefObjInfo
  28. {
  29. std::string defName;
  30. int priority;
  31. int type, subtype;
  32. int objType;
  33. unsigned char visitMap[6];
  34. unsigned char blockMap[6];
  35. bool operator==(const std::string & por) const;
  36. bool isVisitable() const;
  37. };
  38. class CDefObjInfoHandler
  39. {
  40. public:
  41. std::map<int,std::map<int,CGDefInfo*> > gobjs;
  42. std::map<int,CGDefInfo*> castles;
  43. //std::vector<DefObjInfo> objs;
  44. void load();
  45. };
  46. #endif //COBJINFOECTHANDLER_H