1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Use inheritance instead of composition for campaign header

This commit is contained in:
Ivan Savenko
2023-06-26 01:07:55 +03:00
parent a08fe09517
commit f6b2f58da9
15 changed files with 183 additions and 132 deletions

View File

@@ -14,7 +14,7 @@ VCMI_LIB_NAMESPACE_BEGIN
struct StartInfo;
class CMapHeader;
class CampaignHeader;
class Campaign;
class ResourceID;
/**
@@ -25,7 +25,7 @@ class DLL_LINKAGE CMapInfo
{
public:
std::unique_ptr<CMapHeader> mapHeader; //may be nullptr if campaign
std::unique_ptr<CampaignHeader> campaignHeader; //may be nullptr if scenario
std::unique_ptr<Campaign> campaign; //may be nullptr if scenario
StartInfo * scenarioOptionsOfSave; // Options with which scenario has been started (used only with saved games)
std::string fileURI;
std::string date;
@@ -58,7 +58,7 @@ public:
template <typename Handler> void serialize(Handler &h, const int Version)
{
h & mapHeader;
h & campaignHeader;
h & campaign;
h & scenarioOptionsOfSave;
h & fileURI;
h & date;