Browse Source

Moved road & river handlers into a separate file

Ivan Savenko 2 years ago
parent
commit
e48bd39b9c

+ 1 - 0
client/CPlayerInterface.cpp

@@ -61,6 +61,7 @@
 #include "windows/InfoWindows.h"
 #include "../lib/UnlockGuard.h"
 #include "../lib/CPathfinder.h"
+#include "../lib/RoadHandler.h"
 #include "../lib/TerrainHandler.h"
 #include <SDL.h>
 #include "CServerHandler.h"

+ 1 - 1
client/lobby/RandomMapTab.cpp

@@ -29,7 +29,7 @@
 #include "../../lib/rmg/CMapGenOptions.h"
 #include "../../lib/CModHandler.h"
 #include "../../lib/rmg/CRmgTemplateStorage.h"
-#include "../../lib/TerrainHandler.h"
+#include "../../lib/RoadHandler.h"
 
 RandomMapTab::RandomMapTab():
 	InterfaceObjectConfigurable()

+ 2 - 0
client/mapHandler.cpp

@@ -30,6 +30,8 @@
 #include "CMT.h"
 #include "CMusicHandler.h"
 #include "../lib/CRandomGenerator.h"
+#include "../lib/RoadHandler.h"
+#include "../lib/RiverHandler.h"
 #include "../lib/TerrainHandler.h"
 #include "../lib/filesystem/ResourceID.h"
 #include "../lib/JsonDetail.h"

+ 4 - 0
cmake_modules/VCMI_lib.cmake

@@ -191,6 +191,8 @@ macro(add_main_lib TARGET_NAME LIBRARY_TYPE)
 		${MAIN_LIB_DIR}/ObstacleHandler.cpp
 		${MAIN_LIB_DIR}/StartInfo.cpp
 		${MAIN_LIB_DIR}/ResourceSet.cpp
+		${MAIN_LIB_DIR}/RiverHandler.cpp
+		${MAIN_LIB_DIR}/RoadHandler.cpp
 		${MAIN_LIB_DIR}/ScriptHandler.cpp
 		${MAIN_LIB_DIR}/TerrainHandler.cpp
 		${MAIN_LIB_DIR}/VCMIDirs.cpp
@@ -439,6 +441,8 @@ macro(add_main_lib TARGET_NAME LIBRARY_TYPE)
 		${MAIN_LIB_DIR}/ObstacleHandler.h
 		${MAIN_LIB_DIR}/PathfinderUtil.h
 		${MAIN_LIB_DIR}/ResourceSet.h
+		${MAIN_LIB_DIR}/RiverHandler.h
+		${MAIN_LIB_DIR}/RoadHandler.h
 		${MAIN_LIB_DIR}/ScriptHandler.h
 		${MAIN_LIB_DIR}/ScopeGuard.h
 		${MAIN_LIB_DIR}/StartInfo.h

+ 0 - 1
lib/CCreatureHandler.cpp

@@ -16,7 +16,6 @@
 #include "CGameState.h"
 #include "CTownHandler.h"
 #include "CModHandler.h"
-#include "TerrainHandler.h"
 #include "StringConstants.h"
 #include "serializer/JsonDeserializer.h"
 #include "serializer/JsonUpdater.h"

+ 0 - 1
lib/CGeneralTextHandler.cpp

@@ -18,7 +18,6 @@
 #include "GameConstants.h"
 #include "mapObjects/CQuest.h"
 #include "VCMI_Lib.h"
-#include "TerrainHandler.h"
 
 VCMI_LIB_NAMESPACE_BEGIN
 

+ 2 - 0
lib/CModHandler.cpp

@@ -25,6 +25,8 @@
 #include "spells/CSpellHandler.h"
 #include "CSkillHandler.h"
 #include "ScriptHandler.h"
+#include "RoadHandler.h"
+#include "RiverHandler.h"
 #include "TerrainHandler.h"
 #include "BattleFieldHandler.h"
 #include "ObstacleHandler.h"

+ 0 - 1
lib/CPathfinder.cpp

@@ -18,7 +18,6 @@
 #include "CStopWatch.h"
 #include "CConfigHandler.h"
 #include "CPlayerState.h"
-#include "TerrainHandler.h"
 #include "PathfinderUtil.h"
 
 VCMI_LIB_NAMESPACE_BEGIN

+ 2 - 0
lib/IGameCallback.cpp

@@ -32,6 +32,8 @@
 #include "CPlayerState.h"
 #include "CSkillHandler.h"
 #include "ScriptHandler.h"
+#include "RoadHandler.h"
+#include "RiverHandler.h"
 #include "TerrainHandler.h"
 
 #include "serializer/Connection.h"

+ 78 - 0
lib/RiverHandler.cpp

@@ -0,0 +1,78 @@
+/*
+ * Terrain.cpp, part of VCMI engine
+ *
+ * Authors: listed in file AUTHORS in main folder
+ *
+ * License: GNU General Public License v2.0 or later
+ * Full text of license available in license.txt file, in main folder
+ *
+ */
+
+#include "StdInc.h"
+#include "RiverHandler.h"
+#include "CModHandler.h"
+#include "CGeneralTextHandler.h"
+
+VCMI_LIB_NAMESPACE_BEGIN
+
+RiverTypeHandler::RiverTypeHandler()
+{
+	objects.push_back(new RiverType);
+}
+
+RiverType * RiverTypeHandler::loadFromJson(
+	const std::string & scope,
+	const JsonNode & json,
+	const std::string & identifier,
+	size_t index)
+{
+	RiverType * info = new RiverType;
+
+	info->id              = RiverId(index);
+	if (identifier.find(':') == std::string::npos)
+		info->identifier = scope + ":" + identifier;
+	else
+		info->identifier = identifier;
+
+	info->tilesFilename   = json["tilesFilename"].String();
+	info->shortIdentifier = json["shortIdentifier"].String();
+	info->deltaName       = json["delta"].String();
+
+	VLC->generaltexth->registerString(info->getNameTextID(), json["text"].String());
+
+	return info;
+}
+
+const std::vector<std::string> & RiverTypeHandler::getTypeNames() const
+{
+	static const std::vector<std::string> typeNames = { "river" };
+	return typeNames;
+}
+
+std::vector<JsonNode> RiverTypeHandler::loadLegacyData(size_t dataSize)
+{
+	objects.resize(dataSize);
+	return {};
+}
+
+std::vector<bool> RiverTypeHandler::getDefaultAllowed() const
+{
+	return {};
+}
+
+std::string RiverType::getNameTextID() const
+{
+	return TextIdentifier( "river", identifier,  "name" ).get();
+}
+
+std::string RiverType::getNameTranslated() const
+{
+	return VLC->generaltexth->translate(getNameTextID());
+}
+
+RiverType::RiverType():
+	id(River::NO_RIVER),
+	identifier("core:empty")
+{}
+
+VCMI_LIB_NAMESPACE_END

+ 79 - 0
lib/RiverHandler.h

@@ -0,0 +1,79 @@
+/*
+ * TerrainHandler.h, part of VCMI engine
+ *
+ * Authors: listed in file AUTHORS in main folder
+ *
+ * License: GNU General Public License v2.0 or later
+ * Full text of license available in license.txt file, in main folder
+ *
+ */
+
+#pragma once
+
+#include <vcmi/EntityService.h>
+#include <vcmi/Entity.h>
+#include "GameConstants.h"
+#include "IHandlerBase.h"
+
+VCMI_LIB_NAMESPACE_BEGIN
+
+class DLL_LINKAGE RiverType : public EntityT<RiverId>
+{
+	friend class RiverTypeHandler;
+	std::string identifier;
+	RiverId id;
+
+	const std::string & getName() const override { return identifier;}
+public:
+	int32_t getIndex() const override { return id.getNum(); }
+	int32_t getIconIndex() const override { return 0; }
+	const std::string & getJsonKey() const override { return identifier;}
+	void registerIcons(const IconRegistar & cb) const override {}
+	RiverId getId() const override { return id;}
+	void updateFrom(const JsonNode & data) {};
+
+	std::string getNameTextID() const;
+	std::string getNameTranslated() const;
+
+	std::string tilesFilename;
+	std::string shortIdentifier;
+	std::string deltaName;
+
+	RiverType();
+
+	template <typename Handler> void serialize(Handler& h, const int version)
+	{
+		h & tilesFilename;
+		h & identifier;
+		h & deltaName;
+		h & id;
+	}
+};
+
+class DLL_LINKAGE RiverTypeService : public EntityServiceT<RiverId, RiverType>
+{
+public:
+};
+
+class DLL_LINKAGE RiverTypeHandler : public CHandlerBase<RiverId, RiverType, RiverType, RiverTypeService>
+{
+public:
+	virtual RiverType * loadFromJson(
+		const std::string & scope,
+		const JsonNode & json,
+		const std::string & identifier,
+		size_t index) override;
+
+	RiverTypeHandler();
+
+	virtual const std::vector<std::string> & getTypeNames() const override;
+	virtual std::vector<JsonNode> loadLegacyData(size_t dataSize) override;
+	virtual std::vector<bool> getDefaultAllowed() const override;
+
+	template <typename Handler> void serialize(Handler & h, const int version)
+	{
+		h & objects;
+	}
+};
+
+VCMI_LIB_NAMESPACE_END

+ 78 - 0
lib/RoadHandler.cpp

@@ -0,0 +1,78 @@
+/*
+ * Terrain.cpp, part of VCMI engine
+ *
+ * Authors: listed in file AUTHORS in main folder
+ *
+ * License: GNU General Public License v2.0 or later
+ * Full text of license available in license.txt file, in main folder
+ *
+ */
+
+#include "StdInc.h"
+#include "RoadHandler.h"
+#include "CModHandler.h"
+#include "CGeneralTextHandler.h"
+
+VCMI_LIB_NAMESPACE_BEGIN
+
+RoadTypeHandler::RoadTypeHandler()
+{
+	objects.push_back(new RoadType);
+}
+
+RoadType * RoadTypeHandler::loadFromJson(
+	const std::string & scope,
+	const JsonNode & json,
+	const std::string & identifier,
+	size_t index)
+{
+	RoadType * info = new RoadType;
+
+	info->id              = RoadId(index);
+	if (identifier.find(':') == std::string::npos)
+		info->identifier = scope + ":" + identifier;
+	else
+		info->identifier = identifier;
+
+	info->tilesFilename   = json["tilesFilename"].String();
+	info->shortIdentifier = json["shortIdentifier"].String();
+	info->movementCost    = json["moveCost"].Integer();
+
+	VLC->generaltexth->registerString(info->getNameTextID(), json["text"].String());
+
+	return info;
+}
+
+const std::vector<std::string> & RoadTypeHandler::getTypeNames() const
+{
+	static const std::vector<std::string> typeNames = { "road" };
+	return typeNames;
+}
+
+std::vector<JsonNode> RoadTypeHandler::loadLegacyData(size_t dataSize)
+{
+	objects.resize(dataSize);
+	return {};
+}
+
+std::vector<bool> RoadTypeHandler::getDefaultAllowed() const
+{
+	return {};
+}
+
+std::string RoadType::getNameTextID() const
+{
+	return TextIdentifier( "road", identifier,  "name" ).get();
+}
+
+std::string RoadType::getNameTranslated() const
+{
+	return VLC->generaltexth->translate(getNameTextID());
+}
+
+RoadType::RoadType():
+	id(Road::NO_ROAD),
+	identifier("core:empty"),
+	movementCost(GameConstants::BASE_MOVEMENT_COST)
+{}
+VCMI_LIB_NAMESPACE_END

+ 79 - 0
lib/RoadHandler.h

@@ -0,0 +1,79 @@
+/*
+ * TerrainHandler.h, part of VCMI engine
+ *
+ * Authors: listed in file AUTHORS in main folder
+ *
+ * License: GNU General Public License v2.0 or later
+ * Full text of license available in license.txt file, in main folder
+ *
+ */
+
+#pragma once
+
+#include <vcmi/EntityService.h>
+#include <vcmi/Entity.h>
+#include "GameConstants.h"
+#include "IHandlerBase.h"
+
+VCMI_LIB_NAMESPACE_BEGIN
+
+class DLL_LINKAGE RoadType : public EntityT<RoadId>
+{
+	friend class RoadTypeHandler;
+	std::string identifier;
+	RoadId id;
+
+	const std::string & getName() const override { return identifier;}
+public:
+	int32_t getIndex() const override { return id.getNum(); }
+	int32_t getIconIndex() const override { return 0; }
+	const std::string & getJsonKey() const override { return identifier;}
+	void registerIcons(const IconRegistar & cb) const override {}
+	RoadId getId() const override { return id;}
+	void updateFrom(const JsonNode & data) {};
+
+	std::string getNameTextID() const;
+	std::string getNameTranslated() const;
+
+	std::string tilesFilename;
+	std::string shortIdentifier;
+	ui8 movementCost;
+
+	RoadType();
+
+	template <typename Handler> void serialize(Handler& h, const int version)
+	{
+		h & tilesFilename;
+		h & identifier;
+		h & id;
+		h & movementCost;
+	}
+};
+
+class DLL_LINKAGE RoadTypeService : public EntityServiceT<RoadId, RoadType>
+{
+public:
+};
+
+class DLL_LINKAGE RoadTypeHandler : public CHandlerBase<RoadId, RoadType, RoadType, RoadTypeService>
+{
+public:
+	virtual RoadType * loadFromJson(
+		const std::string & scope,
+		const JsonNode & json,
+		const std::string & identifier,
+		size_t index) override;
+
+	RoadTypeHandler();
+
+	virtual const std::vector<std::string> & getTypeNames() const override;
+	virtual std::vector<JsonNode> loadLegacyData(size_t dataSize) override;
+	virtual std::vector<bool> getDefaultAllowed() const override;
+
+	template <typename Handler> void serialize(Handler & h, const int version)
+	{
+		h & objects;
+	}
+};
+
+VCMI_LIB_NAMESPACE_END

+ 0 - 121
lib/TerrainHandler.cpp

@@ -10,7 +10,6 @@
 
 #include "StdInc.h"
 #include "TerrainHandler.h"
-#include "VCMI_Lib.h"
 #include "CModHandler.h"
 #include "CGeneralTextHandler.h"
 
@@ -136,96 +135,6 @@ std::vector<bool> TerrainTypeHandler::getDefaultAllowed() const
 	return {};
 }
 
-RiverTypeHandler::RiverTypeHandler()
-{
-	objects.push_back(new RiverType);
-}
-
-RiverType * RiverTypeHandler::loadFromJson(
-	const std::string & scope,
-	const JsonNode & json,
-	const std::string & identifier,
-	size_t index)
-{
-	RiverType * info = new RiverType;
-
-	info->id              = RiverId(index);
-	if (identifier.find(':') == std::string::npos)
-		info->identifier = scope + ":" + identifier;
-	else
-		info->identifier = identifier;
-
-	info->tilesFilename   = json["tilesFilename"].String();
-	info->shortIdentifier = json["shortIdentifier"].String();
-	info->deltaName       = json["delta"].String();
-
-	VLC->generaltexth->registerString(info->getNameTextID(), json["text"].String());
-
-	return info;
-}
-
-const std::vector<std::string> & RiverTypeHandler::getTypeNames() const
-{
-	static const std::vector<std::string> typeNames = { "river" };
-	return typeNames;
-}
-
-std::vector<JsonNode> RiverTypeHandler::loadLegacyData(size_t dataSize)
-{
-	objects.resize(dataSize);
-	return {};
-}
-
-std::vector<bool> RiverTypeHandler::getDefaultAllowed() const
-{
-	return {};
-}
-
-RoadTypeHandler::RoadTypeHandler()
-{
-	objects.push_back(new RoadType);
-}
-
-RoadType * RoadTypeHandler::loadFromJson(
-	const std::string & scope,
-	const JsonNode & json,
-	const std::string & identifier,
-	size_t index)
-{
-	RoadType * info = new RoadType;
-
-	info->id              = RoadId(index);
-	if (identifier.find(':') == std::string::npos)
-		info->identifier = scope + ":" + identifier;
-	else
-		info->identifier = identifier;
-
-	info->tilesFilename   = json["tilesFilename"].String();
-	info->shortIdentifier = json["shortIdentifier"].String();
-	info->movementCost    = json["moveCost"].Integer();
-
-	VLC->generaltexth->registerString(info->getNameTextID(), json["text"].String());
-
-	return info;
-}
-
-const std::vector<std::string> & RoadTypeHandler::getTypeNames() const
-{
-	static const std::vector<std::string> typeNames = { "road" };
-	return typeNames;
-}
-
-std::vector<JsonNode> RoadTypeHandler::loadLegacyData(size_t dataSize)
-{
-	objects.resize(dataSize);
-	return {};
-}
-
-std::vector<bool> RoadTypeHandler::getDefaultAllowed() const
-{
-	return {};
-}
-
 bool TerrainType::isLand() const
 {
 	return !isWater();
@@ -279,34 +188,4 @@ std::string TerrainType::getNameTranslated() const
 TerrainType::TerrainType()
 {}
 
-std::string RoadType::getNameTextID() const
-{
-	return TextIdentifier( "road", identifier,  "name" ).get();
-}
-
-std::string RoadType::getNameTranslated() const
-{
-	return VLC->generaltexth->translate(getNameTextID());
-}
-
-std::string RiverType::getNameTextID() const
-{
-	return TextIdentifier( "river", identifier,  "name" ).get();
-}
-
-std::string RiverType::getNameTranslated() const
-{
-	return VLC->generaltexth->translate(getNameTextID());
-}
-
-RiverType::RiverType():
-	id(River::NO_RIVER),
-	identifier("core:empty")
-{}
-
-RoadType::RoadType():
-	id(Road::NO_ROAD),
-	identifier("core:empty"),
-	movementCost(GameConstants::BASE_MOVEMENT_COST)
-{}
 VCMI_LIB_NAMESPACE_END

+ 0 - 120
lib/TerrainHandler.h

@@ -12,9 +12,7 @@
 
 #include <vcmi/EntityService.h>
 #include <vcmi/Entity.h>
-#include "ConstTransitivePtr.h"
 #include "GameConstants.h"
-#include "JsonNode.h"
 #include "IHandlerBase.h"
 
 VCMI_LIB_NAMESPACE_BEGIN
@@ -97,87 +95,11 @@ public:
 	}
 };
 
-class DLL_LINKAGE RiverType : public EntityT<RiverId>
-{
-	friend class RiverTypeHandler;
-	std::string identifier;
-	RiverId id;
-
-	const std::string & getName() const override { return identifier;}
-public:
-	int32_t getIndex() const override { return id.getNum(); }
-	int32_t getIconIndex() const override { return 0; }
-	const std::string & getJsonKey() const override { return identifier;}
-	void registerIcons(const IconRegistar & cb) const override {}
-	RiverId getId() const override { return id;}
-	void updateFrom(const JsonNode & data) {};
-
-	std::string getNameTextID() const;
-	std::string getNameTranslated() const;
-
-	std::string tilesFilename;
-	std::string shortIdentifier;
-	std::string deltaName;
-
-	RiverType();
-
-	template <typename Handler> void serialize(Handler& h, const int version)
-	{
-		h & tilesFilename;
-		h & identifier;
-		h & deltaName;
-		h & id;
-	}
-};
-
-class DLL_LINKAGE RoadType : public EntityT<RoadId>
-{
-	friend class RoadTypeHandler;
-	std::string identifier;
-	RoadId id;
-
-	const std::string & getName() const override { return identifier;}
-public:
-	int32_t getIndex() const override { return id.getNum(); }
-	int32_t getIconIndex() const override { return 0; }
-	const std::string & getJsonKey() const override { return identifier;}
-	void registerIcons(const IconRegistar & cb) const override {}
-	RoadId getId() const override { return id;}
-	void updateFrom(const JsonNode & data) {};
-
-	std::string getNameTextID() const;
-	std::string getNameTranslated() const;
-
-	std::string tilesFilename;
-	std::string shortIdentifier;
-	ui8 movementCost;
-
-	RoadType();
-
-	template <typename Handler> void serialize(Handler& h, const int version)
-	{
-		h & tilesFilename;
-		h & identifier;
-		h & id;
-		h & movementCost;
-	}
-};
-
 class DLL_LINKAGE TerrainTypeService : public EntityServiceT<TerrainId, TerrainType>
 {
 public:
 };
 
-class DLL_LINKAGE RiverTypeService : public EntityServiceT<RiverId, RiverType>
-{
-public:
-};
-
-class DLL_LINKAGE RoadTypeService : public EntityServiceT<RoadId, RoadType>
-{
-public:
-};
-
 class DLL_LINKAGE TerrainTypeHandler : public CHandlerBase<TerrainId, TerrainType, TerrainType, TerrainTypeService>
 {
 public:
@@ -197,46 +119,4 @@ public:
 	}
 };
 
-class DLL_LINKAGE RiverTypeHandler : public CHandlerBase<RiverId, RiverType, RiverType, RiverTypeService>
-{
-public:
-	virtual RiverType * loadFromJson(
-		const std::string & scope,
-		const JsonNode & json,
-		const std::string & identifier,
-		size_t index) override;
-
-	RiverTypeHandler();
-
-	virtual const std::vector<std::string> & getTypeNames() const override;
-	virtual std::vector<JsonNode> loadLegacyData(size_t dataSize) override;
-	virtual std::vector<bool> getDefaultAllowed() const override;
-
-	template <typename Handler> void serialize(Handler & h, const int version)
-	{
-		h & objects;
-	}
-};
-
-class DLL_LINKAGE RoadTypeHandler : public CHandlerBase<RoadId, RoadType, RoadType, RoadTypeService>
-{
-public:
-	virtual RoadType * loadFromJson(
-		const std::string & scope,
-		const JsonNode & json,
-		const std::string & identifier,
-		size_t index) override;
-
-	RoadTypeHandler();
-
-	virtual const std::vector<std::string> & getTypeNames() const override;
-	virtual std::vector<JsonNode> loadLegacyData(size_t dataSize) override;
-	virtual std::vector<bool> getDefaultAllowed() const override;
-
-	template <typename Handler> void serialize(Handler & h, const int version)
-	{
-		h & objects;
-	}
-};
-
 VCMI_LIB_NAMESPACE_END

+ 2 - 0
lib/VCMI_Lib.cpp

@@ -18,6 +18,8 @@
 #include "CHeroHandler.h"
 #include "mapObjects/CObjectHandler.h"
 #include "CTownHandler.h"
+#include "RoadHandler.h"
+#include "RiverHandler.h"
 #include "TerrainHandler.h"
 #include "CBuildingHandler.h"
 #include "spells/CSpellHandler.h"

+ 0 - 1
lib/battle/BattleInfo.cpp

@@ -15,7 +15,6 @@
 #include "../filesystem/Filesystem.h"
 #include "../mapObjects/CGTownInstance.h"
 #include "../CGeneralTextHandler.h"
-#include "../TerrainHandler.h"
 #include "../BattleFieldHandler.h"
 #include "../ObstacleHandler.h"
 

+ 0 - 1
lib/battle/BattleProxy.cpp

@@ -10,7 +10,6 @@
 #include "StdInc.h"
 #include "BattleProxy.h"
 #include "Unit.h"
-#include "TerrainHandler.h"
 
 VCMI_LIB_NAMESPACE_BEGIN
 

+ 1 - 0
lib/mapObjects/CGHeroInstance.cpp

@@ -18,6 +18,7 @@
 #include "../CGeneralTextHandler.h"
 #include "../CHeroHandler.h"
 #include "../TerrainHandler.h"
+#include "../RoadHandler.h"
 #include "../CModHandler.h"
 #include "../CSoundBase.h"
 #include "../spells/CSpellHandler.h"

+ 2 - 1
lib/mapping/CDrawRoadsOperation.cpp

@@ -12,7 +12,8 @@
 #include "CDrawRoadsOperation.h"
 #include "CMap.h"
 
-#include "../TerrainHandler.h"
+#include "../RoadHandler.h"
+#include "../RiverHandler.h"
 
 VCMI_LIB_NAMESPACE_BEGIN
 

+ 2 - 0
lib/mapping/CMap.cpp

@@ -15,6 +15,8 @@
 #include "../CCreatureHandler.h"
 #include "../CTownHandler.h"
 #include "../CHeroHandler.h"
+#include "../RiverHandler.h"
+#include "../RoadHandler.h"
 #include "../TerrainHandler.h"
 #include "../mapObjects/CObjectClassesHandler.h"
 #include "../mapObjects/CGHeroInstance.h"

+ 2 - 0
lib/mapping/MapFormatH3M.cpp

@@ -25,6 +25,8 @@
 #include "../mapObjects/MapObjects.h"
 #include "../VCMI_Lib.h"
 #include "../TerrainHandler.h"
+#include "../RoadHandler.h"
+#include "../RiverHandler.h"
 #include "../NetPacksBase.h"
 
 VCMI_LIB_NAMESPACE_BEGIN

+ 2 - 0
lib/mapping/MapFormatJson.cpp

@@ -19,6 +19,8 @@
 #include "../CHeroHandler.h"
 #include "../CTownHandler.h"
 #include "../VCMI_Lib.h"
+#include "../RiverHandler.h"
+#include "../RoadHandler.h"
 #include "../TerrainHandler.h"
 #include "../mapObjects/ObjectTemplate.h"
 #include "../mapObjects/CObjectHandler.h"

+ 2 - 0
lib/registerTypes/TypesLobbyPacks.cpp

@@ -22,6 +22,8 @@
 #include "../CHeroHandler.h"
 #include "../spells/CSpellHandler.h"
 #include "../CTownHandler.h"
+#include "../RoadHandler.h"
+#include "../RiverHandler.h"
 #include "../TerrainHandler.h"
 #include "../mapping/CCampaignHandler.h"
 #include "../NetPacks.h"

+ 1 - 0
lib/rmg/RiverPlacer.cpp

@@ -13,6 +13,7 @@
 #include "Functions.h"
 #include "CMapGenerator.h"
 #include "RmgMap.h"
+#include "../RiverHandler.h"
 #include "../TerrainHandler.h"
 #include "../mapping/CMap.h"
 #include "../mapping/CMapEditManager.h"

+ 2 - 0
mapeditor/mainwindow.cpp

@@ -27,6 +27,8 @@
 #include "../lib/mapping/CMapService.h"
 #include "../lib/mapping/CMap.h"
 #include "../lib/mapping/CMapEditManager.h"
+#include "../lib/RoadHandler.h"
+#include "../lib/RiverHandler.h"
 #include "../lib/TerrainHandler.h"
 #include "../lib/mapObjects/CObjectClassesHandler.h"
 #include "../lib/filesystem/CFilesystemLoader.h"

+ 2 - 0
mapeditor/maphandler.cpp

@@ -12,6 +12,8 @@
 #include "StdInc.h"
 #include "maphandler.h"
 #include "graphics.h"
+#include "../lib/RoadHandler.h"
+#include "../lib/RiverHandler.h"
 #include "../lib/TerrainHandler.h"
 #include "../lib/mapping/CMap.h"
 #include "../lib/mapObjects/CGHeroInstance.h"

+ 0 - 1
mapeditor/objectbrowser.cpp

@@ -11,7 +11,6 @@
 #include "StdInc.h"
 #include "objectbrowser.h"
 #include "../lib/mapObjects/CObjectClassesHandler.h"
-#include "../lib/TerrainHandler.h"
 
 ObjectBrowserProxyModel::ObjectBrowserProxyModel(QObject *parent)
 	: QSortFilterProxyModel{parent}, terrain(ETerrainId::ANY_TERRAIN)