2010-10-25 19:06:48 +03:00
|
|
|
#pragma once
|
|
|
|
|
2011-12-14 00:23:17 +03:00
|
|
|
|
2010-10-25 19:06:48 +03:00
|
|
|
|
|
|
|
class CMapHeader;
|
|
|
|
class CCampaignHeader;
|
2010-10-31 00:53:41 +03:00
|
|
|
struct StartInfo;
|
2010-10-25 19:06:48 +03:00
|
|
|
|
2011-02-22 13:52:36 +02:00
|
|
|
/// A class which stores the count of human players and all players, the filename,
|
|
|
|
/// scenario options, the map header information,...
|
2011-12-14 00:23:17 +03:00
|
|
|
class DLL_LINKAGE CMapInfo
|
2010-10-25 19:06:48 +03:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
CMapHeader * mapHeader; //may be NULL if campaign
|
|
|
|
CCampaignHeader * campaignHeader; //may be NULL if scenario
|
|
|
|
StartInfo *scenarioOpts; //options with which scenario has been started (used only with saved games)
|
2012-08-01 15:02:54 +03:00
|
|
|
std::string fileURI;
|
2010-10-25 19:06:48 +03:00
|
|
|
std::string date;
|
|
|
|
int playerAmnt, //players in map
|
2012-08-01 15:02:54 +03:00
|
|
|
humanPlayers; //players ALLOWED to be controlled by human
|
2010-10-25 19:06:48 +03:00
|
|
|
int actualHumanPlayers; // >1 if multiplayer game
|
|
|
|
CMapInfo(bool map = true);
|
|
|
|
~CMapInfo();
|
2011-12-14 00:23:17 +03:00
|
|
|
//CMapInfo(const std::string &fname, const ui8 *map);
|
2010-10-25 19:06:48 +03:00
|
|
|
void setHeader(CMapHeader *header);
|
2011-12-14 00:23:17 +03:00
|
|
|
void mapInit(const std::string &fname, const ui8 *map);
|
2010-10-25 19:06:48 +03:00
|
|
|
void campaignInit();
|
|
|
|
void countPlayers();
|
|
|
|
|
|
|
|
template <typename Handler> void serialize(Handler &h, const int Version)
|
|
|
|
{
|
2012-08-01 15:02:54 +03:00
|
|
|
h & mapHeader & campaignHeader & scenarioOpts & fileURI & date & playerAmnt & humanPlayers;
|
2010-10-25 19:06:48 +03:00
|
|
|
h & actualHumanPlayers;
|
|
|
|
}
|
2010-10-31 00:53:41 +03:00
|
|
|
};
|