CMapInfo.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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 fileURI;
  14. std::string date;
  15. int playerAmnt, //players in map
  16. humanPlayers; //players ALLOWED to be controlled by human
  17. int actualHumanPlayers; // >1 if multiplayer game
  18. CMapInfo(bool map = true);
  19. ~CMapInfo();
  20. //CMapInfo(const std::string &fname, const ui8 *map);
  21. void setHeader(CMapHeader *header);
  22. void mapInit(const std::string &fname, const ui8 *map);
  23. void campaignInit();
  24. void countPlayers();
  25. template <typename Handler> void serialize(Handler &h, const int Version)
  26. {
  27. h & mapHeader & campaignHeader & scenarioOpts & fileURI & date & playerAmnt & humanPlayers;
  28. h & actualHumanPlayers;
  29. }
  30. };