CMapInfo.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include "../global.h"
  3. class CMapHeader;
  4. class CCampaignHeader;
  5. struct StartInfo;
  6. /// A class which stores the count of human players and all players, the filename,
  7. /// scenario options, the map header information,...
  8. class DLL_EXPORT CMapInfo
  9. {
  10. public:
  11. CMapHeader * mapHeader; //may be NULL if campaign
  12. CCampaignHeader * campaignHeader; //may be NULL if scenario
  13. StartInfo *scenarioOpts; //options with which scenario has been started (used only with saved games)
  14. std::string filename;
  15. bool lodCmpgn; //tells if this campaign is located in Lod file
  16. std::string date;
  17. int playerAmnt, //players in map
  18. humenPlayers; //players ALLOWED to be controlled by human
  19. int actualHumanPlayers; // >1 if multiplayer game
  20. CMapInfo(bool map = true);
  21. ~CMapInfo();
  22. //CMapInfo(const std::string &fname, const unsigned char *map);
  23. void setHeader(CMapHeader *header);
  24. void mapInit(const std::string &fname, const unsigned char *map);
  25. void campaignInit();
  26. void countPlayers();
  27. template <typename Handler> void serialize(Handler &h, const int Version)
  28. {
  29. h & mapHeader & campaignHeader & scenarioOpts & filename & lodCmpgn & date & playerAmnt & humenPlayers;
  30. h & actualHumanPlayers;
  31. }
  32. };