1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Renamed Terrain.h/cpp -> TerrainHandler.h/cpp

This commit is contained in:
Ivan Savenko 2023-01-09 01:17:37 +02:00
parent f51b3bca57
commit 4f3ea0d1d9
68 changed files with 90 additions and 37 deletions

View File

@ -20,7 +20,7 @@
#include "../lib/StringConstants.h"
#include "../lib/CRandomGenerator.h"
#include "../lib/VCMIDirs.h"
#include "../lib/Terrain.h"
#include "../lib/TerrainHandler.h"
#define VCMI_SOUND_NAME(x)
#define VCMI_SOUND_FILE(y) #y,

View File

@ -11,7 +11,6 @@
#include "../lib/CConfigHandler.h"
#include "../lib/CSoundBase.h"
#include "../lib/Terrain.h"
struct _Mix_Music;
struct SDL_RWops;

View File

@ -61,6 +61,7 @@
#include "windows/InfoWindows.h"
#include "../lib/UnlockGuard.h"
#include "../lib/CPathfinder.h"
#include "../lib/TerrainHandler.h"
#include <SDL.h>
#include "CServerHandler.h"
// FIXME: only needed for CGameState::mutex

View File

@ -41,6 +41,7 @@
#include "../../lib/mapObjects/CGTownInstance.h"
#include "../../lib/NetPacks.h"
#include "../../lib/UnlockGuard.h"
#include "../../lib/TerrainHandler.h"
CondSh<BattleAction *> BattleInterface::givenCommand(nullptr);

View File

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

View File

@ -30,7 +30,7 @@
#include "CMT.h"
#include "CMusicHandler.h"
#include "../lib/CRandomGenerator.h"
#include "../lib/Terrain.h"
#include "../lib/TerrainHandler.h"
#include "../lib/filesystem/ResourceID.h"
#include "../lib/JsonDetail.h"

View File

@ -41,7 +41,7 @@
#include "../../lib/CHeroHandler.h"
#include "../../lib/CModHandler.h"
#include "../../lib/CTownHandler.h"
#include "../../lib/Terrain.h"
#include "../../lib/TerrainHandler.h"
#include "../../lib/filesystem/Filesystem.h"
#include "../../lib/JsonNode.h"
#include "../../lib/mapObjects/CGHeroInstance.h"

View File

@ -11,7 +11,6 @@
#include "ObjectLists.h"
#include "../../lib/FunctionList.h"
#include "Terrain.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -53,6 +53,7 @@
#include "../../lib/VCMI_Lib.h"
#include "../../lib/StartInfo.h"
#include "../../lib/mapping/CMapInfo.h"
#include "../../lib/TerrainHandler.h"
#define ADVOPT (conf.go()->ac)
using namespace CSDL_Ext;

View File

@ -192,7 +192,7 @@ macro(add_main_lib TARGET_NAME LIBRARY_TYPE)
${MAIN_LIB_DIR}/StartInfo.cpp
${MAIN_LIB_DIR}/ResourceSet.cpp
${MAIN_LIB_DIR}/ScriptHandler.cpp
${MAIN_LIB_DIR}/Terrain.cpp
${MAIN_LIB_DIR}/TerrainHandler.cpp
${MAIN_LIB_DIR}/VCMIDirs.cpp
${MAIN_LIB_DIR}/VCMI_Lib.cpp
@ -443,7 +443,7 @@ macro(add_main_lib TARGET_NAME LIBRARY_TYPE)
${MAIN_LIB_DIR}/ScopeGuard.h
${MAIN_LIB_DIR}/StartInfo.h
${MAIN_LIB_DIR}/StringConstants.h
${MAIN_LIB_DIR}/Terrain.h
${MAIN_LIB_DIR}/TerrainHandler.h
${MAIN_LIB_DIR}/UnlockGuard.h
${MAIN_LIB_DIR}/VCMIDirs.h
${MAIN_LIB_DIR}/vcmi_endian.h

View File

@ -14,7 +14,6 @@
#include "HeroBonus.h"
#include "GameConstants.h"
#include "IHandlerBase.h"
#include "Terrain.h"
#include "battle/BattleHex.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

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

View File

@ -19,7 +19,6 @@
#include "JsonNode.h"
#include "IHandlerBase.h"
#include "CRandomGenerator.h"
#include "Terrain.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -17,6 +17,7 @@
#include "battle/BattleInfo.h" // for BattleInfo
#include "NetPacks.h" // for InfoWindow
#include "CModHandler.h"
#include "TerrainHandler.h"
#include "spells/CSpellHandler.h"
#include "mapping/CMap.h"
#include "CPlayerState.h"

View File

@ -20,6 +20,7 @@
#include "CHeroHandler.h"
#include "mapObjects/CObjectHandler.h"
#include "CModHandler.h"
#include "TerrainHandler.h"
#include "CSkillHandler.h"
#include "mapping/CMap.h"
#include "mapping/CMapService.h"

View File

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

View File

@ -19,7 +19,6 @@
#include "CCreatureHandler.h"
#include "CModHandler.h"
#include "CTownHandler.h"
#include "Terrain.h"
#include "mapObjects/CObjectHandler.h" //for hero specialty
#include "CSkillHandler.h"
#include <math.h>

View File

@ -18,7 +18,6 @@
#include "GameConstants.h"
#include "HeroBonus.h"
#include "IHandlerBase.h"
#include "Terrain.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -25,6 +25,7 @@
#include "spells/CSpellHandler.h"
#include "CSkillHandler.h"
#include "ScriptHandler.h"
#include "TerrainHandler.h"
#include "BattleFieldHandler.h"
#include "ObstacleHandler.h"
@ -526,7 +527,7 @@ void CContentHandler::preloadData(CModInfo & mod)
void CContentHandler::load(CModInfo & mod)
{
bool validate = false;//(mod.validation != CModInfo::PASSED);
bool validate = (mod.validation != CModInfo::PASSED);
if (!loadMod(mod.identifier, validate))
mod.validation = CModInfo::FAILED;

View File

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

View File

@ -13,7 +13,6 @@
#include "IGameCallback.h"
#include "HeroBonus.h"
#include "int3.h"
#include "Terrain.h"
#include <boost/heap/fibonacci_heap.hpp>

View File

@ -14,7 +14,6 @@
#include "CCreatureHandler.h" //todo: remove
#include "battle/BattleHex.h"
#include "mapObjects/CGHeroInstance.h" // for commander serialization
#include "Terrain.h"
#include "battle/CUnitState.h"

View File

@ -20,7 +20,6 @@
#include "LogicalExpression.h"
#include "battle/BattleHex.h"
#include "HeroBonus.h"
#include "Terrain.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -22,6 +22,7 @@
#include "CStack.h"
#include "CArtHandler.h"
#include "CModHandler.h"
#include "TerrainHandler.h"
#include "StringConstants.h"
#include "battle/BattleInfo.h"

View File

@ -11,7 +11,6 @@
#include "GameConstants.h"
#include "JsonNode.h"
#include "Terrain.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

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

View File

@ -27,6 +27,7 @@
#include "mapping/CMapInfo.h"
#include "StartInfo.h"
#include "CPlayerState.h"
#include "TerrainHandler.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -13,7 +13,6 @@
#include <vcmi/Entity.h>
#include "GameConstants.h"
#include "IHandlerBase.h"
#include "Terrain.h"
#include "battle/BattleHex.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include "TerrainHandler.h"
#include "mapObjects/CObjectHandler.h"
#include "mapping/CMapDefines.h"
#include "CGameState.h"

View File

@ -9,7 +9,7 @@
*/
#include "StdInc.h"
#include "Terrain.h"
#include "TerrainHandler.h"
#include "VCMI_Lib.h"
#include "CModHandler.h"
#include "CGeneralTextHandler.h"
@ -156,6 +156,8 @@ RiverType * RiverTypeHandler::loadFromJson(
info->shortIdentifier = json["shortIdentifier"].String();
info->deltaName = json["delta"].String();
VLC->generaltexth->registerString(info->getNameTextID(), json["text"].String());
return info;
}
@ -195,6 +197,8 @@ RoadType * RoadTypeHandler::loadFromJson(
info->shortIdentifier = json["shortIdentifier"].String();
info->movementCost = json["moveCost"].Integer();
VLC->generaltexth->registerString(info->getNameTextID(), json["text"].String());
return info;
}
@ -257,8 +261,7 @@ bool TerrainType::isTransitionRequired() const
std::string TerrainType::getNameTextID() const
{
TextIdentifier id{ "terrain", modScope, identifier, "name" };
return id.get();
return TextIdentifier( "terrain", modScope, identifier, "name" ).get();
}
std::string TerrainType::getNameTranslated() const
@ -269,6 +272,26 @@ std::string TerrainType::getNameTranslated() const
TerrainType::TerrainType()
{}
std::string RoadType::getNameTextID() const
{
return TextIdentifier( "terrain", identifier, "name" ).get();
}
std::string RoadType::getNameTranslated() const
{
return VLC->generaltexth->translate(getNameTextID());
}
std::string RiverType::getNameTextID() const
{
return TextIdentifier( "terrain", identifier, "name" ).get();
}
std::string RiverType::getNameTranslated() const
{
return VLC->generaltexth->translate(getNameTextID());
}
RiverType::RiverType():
id(River::NO_RIVER)
{}

View File

@ -1,5 +1,5 @@
/*
* Terrain.h, part of VCMI engine
* TerrainHandler.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
@ -144,6 +144,9 @@ public:
void registerIcons(const IconRegistar & cb) const override {}
RoadId getId() const override { return id;}
std::string getNameTextID() const;
std::string getNameTranslated() const;
std::string tilesFilename;
std::string shortIdentifier;
ui8 movementCost;

View File

@ -18,6 +18,7 @@
#include "CHeroHandler.h"
#include "mapObjects/CObjectHandler.h"
#include "CTownHandler.h"
#include "TerrainHandler.h"
#include "CBuildingHandler.h"
#include "spells/CSpellHandler.h"
#include "spells/effects/Registry.h"

View File

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

View File

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

View File

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

View File

@ -20,6 +20,7 @@
#include "../CGameState.h"
#include "../mapping/CMap.h"
#include "../CPlayerState.h"
#include "../TerrainHandler.h"
#include "../serializer/JsonSerializeFormat.h"
#include "../HeroBonus.h"

View File

@ -15,7 +15,6 @@
#include "../ConstTransitivePtr.h"
#include "../IHandlerBase.h"
#include "../JsonNode.h"
#include "Terrain.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -20,6 +20,7 @@
#include "../CGameState.h"
#include "../StringConstants.h"
#include "../mapping/CMap.h"
#include "../TerrainHandler.h"
#include "CObjectClassesHandler.h"
#include "CGTownInstance.h"

View File

@ -13,6 +13,7 @@
#include "CGTownInstance.h"
#include "CGHeroInstance.h"
#include "CBank.h"
#include "../TerrainHandler.h"
#include "../mapping/CMap.h"
#include "../CHeroHandler.h"
#include "../CCreatureHandler.h"

View File

@ -19,7 +19,7 @@
#include "CObjectHandler.h"
#include "../CModHandler.h"
#include "../JsonNode.h"
#include "../Terrain.h"
#include "../TerrainHandler.h"
#include "CRewardableConstructor.h"

View File

@ -12,6 +12,8 @@
#include "CDrawRoadsOperation.h"
#include "CMap.h"
#include "../TerrainHandler.h"
VCMI_LIB_NAMESPACE_BEGIN
const std::vector<CDrawLinesOperation::LinePattern> CDrawLinesOperation::patterns =

View File

@ -15,6 +15,7 @@
#include "../CCreatureHandler.h"
#include "../CTownHandler.h"
#include "../CHeroHandler.h"
#include "../TerrainHandler.h"
#include "../mapObjects/CObjectClassesHandler.h"
#include "../mapObjects/CGHeroInstance.h"
#include "../CGeneralTextHandler.h"

View File

@ -12,6 +12,10 @@
VCMI_LIB_NAMESPACE_BEGIN
class TerrainType;
class RiverType;
class RoadType;
/// The map event is an event which e.g. gives or takes resources of a specific
/// amount to/from players and can appear regularly or once a time.
class DLL_LINKAGE CMapEvent

View File

@ -12,7 +12,6 @@
#include "../GameConstants.h"
#include "CMapOperation.h"
#include "Terrain.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -12,6 +12,7 @@
#include "CMapOperation.h"
#include "../VCMI_Lib.h"
#include "../TerrainHandler.h"
#include "CMap.h"
#include "MapEditUtils.h"

View File

@ -13,6 +13,7 @@
#include "../filesystem/Filesystem.h"
#include "../JsonNode.h"
#include "../TerrainHandler.h"
#include "CMap.h"
#include "CMapOperation.h"

View File

@ -12,7 +12,7 @@
#include "../int3.h"
#include "../CRandomGenerator.h"
#include "Terrain.h"
#include "../GameConstants.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -24,6 +24,7 @@
#include "../mapObjects/CObjectClassesHandler.h"
#include "../mapObjects/MapObjects.h"
#include "../VCMI_Lib.h"
#include "../TerrainHandler.h"
#include "../NetPacksBase.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -19,6 +19,7 @@
#include "../CHeroHandler.h"
#include "../CTownHandler.h"
#include "../VCMI_Lib.h"
#include "../TerrainHandler.h"
#include "../mapObjects/ObjectTemplate.h"
#include "../mapObjects/CObjectHandler.h"
#include "../mapObjects/CObjectClassesHandler.h"

View File

@ -22,6 +22,7 @@
#include "../CHeroHandler.h"
#include "../spells/CSpellHandler.h"
#include "../CTownHandler.h"
#include "../TerrainHandler.h"
#include "../mapping/CCampaignHandler.h"
#include "../NetPacks.h"
#include "../mapObjects/CObjectClassesHandler.h"

View File

@ -17,7 +17,7 @@
#include "../VCMI_Lib.h"
#include "../CTownHandler.h"
#include "../CModHandler.h"
#include "../Terrain.h"
#include "../TerrainHandler.h"
#include "../serializer/JsonSerializeFormat.h"
#include "../StringConstants.h"

View File

@ -13,7 +13,7 @@
#include "../int3.h"
#include "../GameConstants.h"
#include "../ResourceSet.h"
#include "../Terrain.h"
//#include "../TerrainHandler.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -11,6 +11,7 @@
#include "StdInc.h"
#include "../CRandomGenerator.h"
#include "CZonePlacer.h"
#include "../TerrainHandler.h"
#include "../mapping/CMap.h"
#include "../mapping/CMapEditManager.h"
#include "CMapGenOptions.h"

View File

@ -12,6 +12,7 @@
#include "ConnectionsPlacer.h"
#include "CMapGenerator.h"
#include "RmgMap.h"
#include "../TerrainHandler.h"
#include "../mapping/CMap.h"
#include "../mapping/CMapEditManager.h"
#include "../mapObjects/CObjectClassesHandler.h"

View File

@ -21,6 +21,7 @@
#include "RmgMap.h"
#include "TileInfo.h"
#include "RmgPath.h"
#include "../TerrainHandler.h"
#include "../CTownHandler.h"
#include "../mapping/CMapEditManager.h"
#include "../mapping/CMap.h"

View File

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

View File

@ -18,6 +18,7 @@
#include "../mapObjects/CommonConstructors.h"
#include "../mapObjects/MapObjects.h" //needed to resolve templates for CommonConstructors.h
#include "Functions.h"
#include "../TerrainHandler.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -17,6 +17,7 @@
#include "RmgMap.h"
#include "CMapGenerator.h"
#include "Functions.h"
#include "../TerrainHandler.h"
#include "../CRandomGenerator.h"
#include "../mapping/CMapEditManager.h"

View File

@ -11,7 +11,7 @@
#pragma once
#include "../GameConstants.h"
#include "../Terrain.h"
//#include "../TerrainHandler.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -12,6 +12,7 @@
#include "WaterProxy.h"
#include "CMapGenerator.h"
#include "RmgMap.h"
#include "../TerrainHandler.h"
#include "../mapping/CMap.h"
#include "../mapping/CMapEditManager.h"
#include "../mapObjects/CObjectClassesHandler.h"

View File

@ -27,7 +27,7 @@
#include "../lib/mapping/CMapService.h"
#include "../lib/mapping/CMap.h"
#include "../lib/mapping/CMapEditManager.h"
#include "../lib/Terrain.h"
#include "../lib/TerrainHandler.h"
#include "../lib/mapObjects/CObjectClassesHandler.h"
#include "../lib/filesystem/CFilesystemLoader.h"

View File

@ -4,7 +4,7 @@
#include <QGraphicsScene>
#include <QStandardItemModel>
#include "mapcontroller.h"
#include "../lib/Terrain.h"
//#include "../lib/TerrainHandler.h"
#include "resourceExtractor/ResourceConverter.h"
class ObjectBrowser;

View File

@ -14,7 +14,7 @@
#include "../lib/mapping/CMapService.h"
#include "../lib/mapping/CMap.h"
#include "../lib/mapping/CMapEditManager.h"
#include "../lib/Terrain.h"
#include "../lib/TerrainHandler.h"
#include "../lib/mapObjects/CObjectClassesHandler.h"
#include "../lib/rmg/ObstaclePlacer.h"
#include "../lib/CSkillHandler.h"

View File

@ -13,7 +13,7 @@
#include "maphandler.h"
#include "mapview.h"
#include "../lib/mapping/CMap.h"
#include "../lib/Terrain.h"
//#include "../lib/TerrainHandler.h"
class MainWindow;
class MapController

View File

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

View File

@ -11,6 +11,7 @@
#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)

View File

@ -11,7 +11,7 @@
#pragma once
#include <QSortFilterProxyModel>
#include "../lib/Terrain.h"
#include "../lib/GameConstants.h"
class ObjectBrowserProxyModel : public QSortFilterProxyModel
{

View File

@ -38,6 +38,7 @@
#include "../lib/VCMIDirs.h"
#include "../lib/ScopeGuard.h"
#include "../lib/CSoundBase.h"
#include "../lib/TerrainHandler.h"
#include "CGameHandler.h"
#include "CVCMIServer.h"
#include "../lib/CCreatureSet.h"