CMapInfo.h 1.2 KB

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