Removed all #include's of CMap.h from headers.

To all - please, avoid #include's in headers as much as possible
This kills incremental build compile times
This commit is contained in:
Ivan Savenko committed 2015-12-02 21:05:10 +02:00
1 parent bef7048460
commit c3ce4b25df
33 files changed
+151 -119

No files matched your search

+2
View File
@@ -7,6 +7,8 @@
#include "../../lib/CConfigHandler.h" #include "../../lib/CConfigHandler.h"
#include "../../lib/CHeroHandler.h" #include "../../lib/CHeroHandler.h"
#include "../../lib/mapObjects/CBank.h" #include "../../lib/mapObjects/CBank.h"
#include "../../lib/mapObjects/CGTownInstance.h"
#include "../../lib/mapObjects/CQuest.h"
/* /*
* AIUtility.cpp, part of VCMI engine * AIUtility.cpp, part of VCMI engine
-1
View File
@@ -7,7 +7,6 @@
#include "../../lib/spells/CSpellHandler.h" #include "../../lib/spells/CSpellHandler.h"
#include "../../lib/Connection.h" #include "../../lib/Connection.h"
#include "../../lib/CGameState.h" #include "../../lib/CGameState.h"
#include "../../lib/mapping/CMap.h"
#include "../../lib/NetPacks.h" #include "../../lib/NetPacks.h"
#include "../../lib/CStopWatch.h" #include "../../lib/CStopWatch.h"
+1 -1
View File
@@ -12,10 +12,10 @@
#include "../../lib/CBuildingHandler.h" #include "../../lib/CBuildingHandler.h"
#include "../../lib/CCreatureHandler.h" #include "../../lib/CCreatureHandler.h"
#include "../../lib/CTownHandler.h" #include "../../lib/CTownHandler.h"
#include "../../lib/mapObjects/MiscObjects.h"
#include "../../lib/spells/CSpellHandler.h" #include "../../lib/spells/CSpellHandler.h"
#include "../../lib/Connection.h" #include "../../lib/Connection.h"
#include "../../lib/CGameState.h" #include "../../lib/CGameState.h"
#include "../../lib/mapping/CMap.h"
#include "../../lib/NetPacks.h" #include "../../lib/NetPacks.h"
#include "../../lib/CondSh.h" #include "../../lib/CondSh.h"
+1
View File
@@ -22,6 +22,7 @@
#include "../lib/GameConstants.h" #include "../lib/GameConstants.h"
#include "../lib/CStopWatch.h" #include "../lib/CStopWatch.h"
#include "../lib/mapObjects/CObjectClassesHandler.h" #include "../lib/mapObjects/CObjectClassesHandler.h"
#include "../lib/mapObjects/CObjectHandler.h"
using namespace CSDL_Ext; using namespace CSDL_Ext;
#ifdef min #ifdef min
@@ -29,6 +29,7 @@
#include "../../lib/NetPacks.h" #include "../../lib/NetPacks.h"
#include "../../lib/StartInfo.h" #include "../../lib/StartInfo.h"
#include "../../lib/CondSh.h" #include "../../lib/CondSh.h"
#include "../../lib/mapObjects/CGTownInstance.h"
/* /*
* CBattleInterfaceClasses.cpp, part of VCMI engine * CBattleInterfaceClasses.cpp, part of VCMI engine
+1 -1
View File
@@ -19,7 +19,7 @@
#include "../../lib/CGameState.h" #include "../../lib/CGameState.h"
#include "../../lib/CGeneralTextHandler.h" #include "../../lib/CGeneralTextHandler.h"
#include "../../lib/NetPacksBase.h" #include "../../lib/NetPacksBase.h"
#include "../../lib/mapObjects/CQuest.h"
/* /*
* CQuestLog.cpp, part of VCMI engine * CQuestLog.cpp, part of VCMI engine
* *
+2 -1
View File
@@ -1,4 +1,4 @@
/* /*
* BattleState.cpp, part of VCMI engine * BattleState.cpp, part of VCMI engine
* *
* Authors: listed in file AUTHORS in main folder * Authors: listed in file AUTHORS in main folder
@@ -22,6 +22,7 @@
#include "JsonNode.h" #include "JsonNode.h"
#include "filesystem/Filesystem.h" #include "filesystem/Filesystem.h"
#include "CRandomGenerator.h" #include "CRandomGenerator.h"
#include "mapObjects/CGTownInstance.h"
const CStack * BattleInfo::getNextStack() const const CStack * BattleInfo::getNextStack() const
{ {
+1
View File
@@ -6,6 +6,7 @@
#include "spells/CSpellHandler.h" #include "spells/CSpellHandler.h"
#include "VCMI_Lib.h" #include "VCMI_Lib.h"
#include "CTownHandler.h" #include "CTownHandler.h"
#include "mapObjects/CGTownInstance.h"
/* /*
* CBattleCallback.cpp, part of VCMI engine * CBattleCallback.cpp, part of VCMI engine
+1
View File
@@ -18,6 +18,7 @@
#include "NetPacks.h" // for InfoWindow #include "NetPacks.h" // for InfoWindow
#include "CModHandler.h" #include "CModHandler.h"
#include "spells/CSpellHandler.h" #include "spells/CSpellHandler.h"
#include "mapping/CMap.h"
//TODO make clean //TODO make clean
#define ERROR_VERBOSE_OR_NOT_RET_VAL_IF(cond, verbose, txt, retVal) do {if(cond){if(verbose)logGlobal->errorStream() << BOOST_CURRENT_FUNCTION << ": " << txt; return retVal;}} while(0) #define ERROR_VERBOSE_OR_NOT_RET_VAL_IF(cond, verbose, txt, retVal) do {if(cond){if(verbose)logGlobal->errorStream() << BOOST_CURRENT_FUNCTION << ": " << txt; return retVal;}} while(0)
-5
View File
@@ -1,12 +1,7 @@
#pragma once #pragma once
//#ifndef _MSC_VER
#include "CCreatureHandler.h" #include "CCreatureHandler.h"
#include "VCMI_Lib.h" #include "VCMI_Lib.h"
#include "mapping/CMap.h"
//#endif
#include "HeroBonus.h" #include "HeroBonus.h"
#include "CCreatureSet.h" #include "CCreatureSet.h"
+1
View File
@@ -117,6 +117,7 @@ set(lib_HEADERS
filesystem/ISimpleResourceLoader.h filesystem/ISimpleResourceLoader.h
mapObjects/MapObjects.h mapObjects/MapObjects.h
mapping/CMapDefines.h
CSoundBase.h CSoundBase.h
AI_Base.h AI_Base.h
+3 -1
View File
@@ -1,8 +1,8 @@
#pragma once #pragma once
#include "VCMI_Lib.h" #include "VCMI_Lib.h"
#include "mapping/CMap.h"
#include "IGameCallback.h" #include "IGameCallback.h"
#include "HeroBonus.h"
#include "int3.h" #include "int3.h"
#include <boost/heap/priority_queue.hpp> #include <boost/heap/priority_queue.hpp>
@@ -21,6 +21,8 @@ class CGHeroInstance;
class CGObjectInstance; class CGObjectInstance;
struct TerrainTile; struct TerrainTile;
class CPathfinderHelper; class CPathfinderHelper;
class CMap;
class CGWhirlpool;
struct DLL_LINKAGE CGPathNode struct DLL_LINKAGE CGPathNode
{ {
+1
View File
@@ -2,6 +2,7 @@
#include "Connection.h" #include "Connection.h"
#include "registerTypes/RegisterTypes.h" #include "registerTypes/RegisterTypes.h"
#include "mapping/CMap.h"
#include <boost/asio.hpp> #include <boost/asio.hpp>
+12
View File
@@ -405,6 +405,18 @@ public:
ID_LIKE_OPERATORS(BuildingID, BuildingID::EBuildingID) ID_LIKE_OPERATORS(BuildingID, BuildingID::EBuildingID)
namespace EAiTactic
{
enum EAiTactic
{
NONE = -1,
RANDOM,
WARRIOR,
BUILDER,
EXPLORER
};
}
namespace EBuildingState namespace EBuildingState
{ {
enum EBuildingState enum EBuildingState
+1
View File
@@ -21,6 +21,7 @@
#include "mapObjects/CObjectClassesHandler.h" #include "mapObjects/CObjectClassesHandler.h"
#include "StartInfo.h" #include "StartInfo.h"
#include "CGameState.h" #include "CGameState.h"
#include "mapping/CMap.h"
void CPrivilagedInfoCallback::getFreeTiles (std::vector<int3> &tiles) const void CPrivilagedInfoCallback::getFreeTiles (std::vector<int3> &tiles) const
{ {
+1 -1
View File
@@ -13,7 +13,7 @@
#include "ResourceSet.h" #include "ResourceSet.h"
//#include "CObstacleInstance.h" //#include "CObstacleInstance.h"
#include "CGameStateFwd.h" #include "CGameStateFwd.h"
#include "mapping/CMap.h" #include "mapping/CMapDefines.h"
#include "CObstacleInstance.h" #include "CObstacleInstance.h"
#include "spells/ViewSpellInt.h" #include "spells/ViewSpellInt.h"
+3 -1
View File
@@ -1,4 +1,4 @@
/* /*
* CGHeroInstance.cpp, part of VCMI engine * CGHeroInstance.cpp, part of VCMI engine
* *
* Authors: listed in file AUTHORS in main folder * Authors: listed in file AUTHORS in main folder
@@ -22,6 +22,8 @@
#include "../CGameState.h" #include "../CGameState.h"
#include "../CCreatureHandler.h" #include "../CCreatureHandler.h"
#include "../BattleState.h" #include "../BattleState.h"
#include "../CTownHandler.h"
#include "CGTownInstance.h"
///helpers ///helpers
static void showInfoDialog(const PlayerColor playerID, const ui32 txtID, const ui16 soundID) static void showInfoDialog(const PlayerColor playerID, const ui32 txtID, const ui16 soundID)
+2 -1
View File
@@ -1,4 +1,4 @@
/* /*
* *
* CGMarket.cpp, part of VCMI engine * CGMarket.cpp, part of VCMI engine
* *
@@ -17,6 +17,7 @@
#include "../IGameCallback.h" #include "../IGameCallback.h"
#include "../CCreatureHandler.h" #include "../CCreatureHandler.h"
#include "../CGameState.h" #include "../CGameState.h"
#include "CGTownInstance.h"
///helpers ///helpers
static void openWindow(const OpenWindow::EWindow type, const int id1, const int id2 = -1) static void openWindow(const OpenWindow::EWindow type, const int id1, const int id2 = -1)
+2 -1
View File
@@ -1,4 +1,4 @@
/* /*
* CGTownInstance.cpp, part of VCMI engine * CGTownInstance.cpp, part of VCMI engine
* *
* Authors: listed in file AUTHORS in main folder * Authors: listed in file AUTHORS in main folder
@@ -17,6 +17,7 @@
#include "../CModHandler.h" #include "../CModHandler.h"
#include "../IGameCallback.h" #include "../IGameCallback.h"
#include "../CGameState.h" #include "../CGameState.h"
#include "../mapping/CMapDefines.h"
std::vector<const CArtifact *> CGTownInstance::merchantArtifacts; std::vector<const CArtifact *> CGTownInstance::merchantArtifacts;
std::vector<int> CGTownInstance::universitySkills; std::vector<int> CGTownInstance::universitySkills;
+3 -1
View File
@@ -1,4 +1,4 @@
/* /*
* CObjectHandler.cpp, part of VCMI engine * CObjectHandler.cpp, part of VCMI engine
* *
* Authors: listed in file AUTHORS in main folder * Authors: listed in file AUTHORS in main folder
@@ -18,8 +18,10 @@
#include "../filesystem/ResourceID.h" #include "../filesystem/ResourceID.h"
#include "../IGameCallback.h" #include "../IGameCallback.h"
#include "../CGameState.h" #include "../CGameState.h"
#include "../mapping/CMap.h"
#include "CObjectClassesHandler.h" #include "CObjectClassesHandler.h"
#include "CGTownInstance.h"
IGameCallback * IObjectInterface::cb = nullptr; IGameCallback * IObjectInterface::cb = nullptr;
+1
View File
@@ -17,6 +17,7 @@
#include "../CGeneralTextHandler.h" #include "../CGeneralTextHandler.h"
#include "../CHeroHandler.h" #include "../CHeroHandler.h"
#include "CObjectClassesHandler.h" #include "CObjectClassesHandler.h"
#include "MiscObjects.h"
#include "../IGameCallback.h" #include "../IGameCallback.h"
#include "../CGameState.h" #include "../CGameState.h"
+1
View File
@@ -20,6 +20,7 @@
#include "../spells/CSpellHandler.h" #include "../spells/CSpellHandler.h"
#include "../IGameCallback.h" #include "../IGameCallback.h"
#include "../CGameState.h" #include "../CGameState.h"
#include "../mapping/CMap.h"
std::map <si32, std::vector<ObjectInstanceID> > CGMagi::eyelist; std::map <si32, std::vector<ObjectInstanceID> > CGMagi::eyelist;
ui8 CGObelisk::obeliskCount; //how many obelisks are on map ui8 CGObelisk::obeliskCount; //how many obelisks are on map
+1
View File
@@ -10,6 +10,7 @@
#include "StdInc.h" #include "StdInc.h"
#include "CDrawRoadsOperation.h" #include "CDrawRoadsOperation.h"
#include "CMap.h"
const std::vector<CDrawRoadsOperation::RoadPattern> CDrawRoadsOperation::patterns = const std::vector<CDrawRoadsOperation::RoadPattern> CDrawRoadsOperation::patterns =
{ {
+1 -1
View File
@@ -11,9 +11,9 @@
#pragma once #pragma once
#include "../CRandomGenerator.h" #include "../CRandomGenerator.h"
#include "CMap.h"
#include "CMapEditManager.h" #include "CMapEditManager.h"
struct TerrainTile;
class CDrawRoadsOperation : public CMapOperation class CDrawRoadsOperation : public CMapOperation
{ {
+1 -100
View File
@@ -19,6 +19,7 @@
#include "../int3.h" #include "../int3.h"
#include "../GameConstants.h" #include "../GameConstants.h"
#include "../LogicalExpression.h" #include "../LogicalExpression.h"
#include "CMapDefines.h"
class CArtifactInstance; class CArtifactInstance;
class CGObjectInstance; class CGObjectInstance;
@@ -47,18 +48,6 @@ struct DLL_LINKAGE SHeroName
} }
}; };
namespace EAiTactic
{
enum EAiTactic
{
NONE = -1,
RANDOM,
WARRIOR,
BUILDER,
EXPLORER
};
}
/// The player info constains data about which factions are allowed, AI tactical settings, /// The player info constains data about which factions are allowed, AI tactical settings,
/// the main hero name, where to generate the hero, whether the faction should be selected randomly,... /// the main hero name, where to generate the hero, whether the faction should be selected randomly,...
struct DLL_LINKAGE PlayerInfo struct DLL_LINKAGE PlayerInfo
@@ -216,94 +205,6 @@ struct DLL_LINKAGE DisposedHero
} }
}; };
/// 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
{
public:
CMapEvent();
bool earlierThan(const CMapEvent & other) const;
bool earlierThanOrEqual(const CMapEvent & other) const;
std::string name;
std::string message;
TResources resources;
ui8 players; // affected players, bit field?
ui8 humanAffected;
ui8 computerAffected;
ui32 firstOccurence;
ui32 nextOccurence; /// specifies after how many days the event will occur the next time; 0 if event occurs only one time
template <typename Handler>
void serialize(Handler & h, const int version)
{
h & name & message & resources
& players & humanAffected & computerAffected & firstOccurence & nextOccurence;
}
};
/// The castle event builds/adds buildings/creatures for a specific town.
class DLL_LINKAGE CCastleEvent: public CMapEvent
{
public:
CCastleEvent();
std::set<BuildingID> buildings;
std::vector<si32> creatures;
CGTownInstance * town;
template <typename Handler>
void serialize(Handler & h, const int version)
{
h & static_cast<CMapEvent &>(*this);
h & buildings & creatures;
}
};
/// The terrain tile describes the terrain type and the visual representation of the terrain.
/// Furthermore the struct defines whether the tile is visitable or/and blocked and which objects reside in it.
struct DLL_LINKAGE TerrainTile
{
TerrainTile();
/// Gets true if the terrain is not a rock. If from is water/land, same type is also required.
bool entrableTerrain(const TerrainTile * from = nullptr) const;
bool entrableTerrain(bool allowLand, bool allowSea) const;
/// Checks for blocking objects and terraint type (water / land).
bool isClear(const TerrainTile * from = nullptr) const;
/// Gets the ID of the top visitable object or -1 if there is none.
Obj topVisitableId(bool excludeTop = false) const;
CGObjectInstance * topVisitableObj(bool excludeTop = false) const;
bool isWater() const;
bool isCoastal() const;
EDiggingStatus getDiggingStatus(const bool excludeTop = true) const;
bool hasFavourableWinds() const;
ETerrainType terType;
ui8 terView;
ERiverType::ERiverType riverType;
ui8 riverDir;
ERoadType::ERoadType roadType;
ui8 roadDir;
/// first two bits - how to rotate terrain graphic (next two - river graphic, next two - road);
/// 7th bit - whether tile is coastal (allows disembarking if land or block movement if water); 8th bit - Favourable Winds effect
ui8 extTileFlags;
bool visitable;
bool blocked;
std::vector<CGObjectInstance *> visitableObjects;
std::vector<CGObjectInstance *> blockingObjects;
template <typename Handler>
void serialize(Handler & h, const int version)
{
h & terType & terView & riverType & riverDir & roadType &roadDir & extTileFlags;
h & visitable & blocked;
h & visitableObjects & blockingObjects;
}
};
namespace EMapFormat namespace EMapFormat
{ {
enum EMapFormat enum EMapFormat
+99
View File
@@ -0,0 +1,99 @@
/*
* CMapDefines.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
/// 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
{
public:
CMapEvent();
bool earlierThan(const CMapEvent & other) const;
bool earlierThanOrEqual(const CMapEvent & other) const;
std::string name;
std::string message;
TResources resources;
ui8 players; // affected players, bit field?
ui8 humanAffected;
ui8 computerAffected;
ui32 firstOccurence;
ui32 nextOccurence; /// specifies after how many days the event will occur the next time; 0 if event occurs only one time
template <typename Handler>
void serialize(Handler & h, const int version)
{
h & name & message & resources
& players & humanAffected & computerAffected & firstOccurence & nextOccurence;
}
};
/// The castle event builds/adds buildings/creatures for a specific town.
class DLL_LINKAGE CCastleEvent: public CMapEvent
{
public:
CCastleEvent();
std::set<BuildingID> buildings;
std::vector<si32> creatures;
CGTownInstance * town;
template <typename Handler>
void serialize(Handler & h, const int version)
{
h & static_cast<CMapEvent &>(*this);
h & buildings & creatures;
}
};
/// The terrain tile describes the terrain type and the visual representation of the terrain.
/// Furthermore the struct defines whether the tile is visitable or/and blocked and which objects reside in it.
struct DLL_LINKAGE TerrainTile
{
TerrainTile();
/// Gets true if the terrain is not a rock. If from is water/land, same type is also required.
bool entrableTerrain(const TerrainTile * from = nullptr) const;
bool entrableTerrain(bool allowLand, bool allowSea) const;
/// Checks for blocking objects and terraint type (water / land).
bool isClear(const TerrainTile * from = nullptr) const;
/// Gets the ID of the top visitable object or -1 if there is none.
Obj topVisitableId(bool excludeTop = false) const;
CGObjectInstance * topVisitableObj(bool excludeTop = false) const;
bool isWater() const;
bool isCoastal() const;
EDiggingStatus getDiggingStatus(const bool excludeTop = true) const;
bool hasFavourableWinds() const;
ETerrainType terType;
ui8 terView;
ERiverType::ERiverType riverType;
ui8 riverDir;
ERoadType::ERoadType roadType;
ui8 roadDir;
/// first two bits - how to rotate terrain graphic (next two - river graphic, next two - road);
/// 7th bit - whether tile is coastal (allows disembarking if land or block movement if water); 8th bit - Favourable Winds effect
ui8 extTileFlags;
bool visitable;
bool blocked;
std::vector<CGObjectInstance *> visitableObjects;
std::vector<CGObjectInstance *> blockingObjects;
template <typename Handler>
void serialize(Handler & h, const int version)
{
h & terType & terView & riverType & riverDir & roadType &roadDir & extTileFlags;
h & visitable & blocked;
h & visitableObjects & blockingObjects;
}
};
+1
View File
@@ -7,6 +7,7 @@
#include "../mapObjects/CGHeroInstance.h" #include "../mapObjects/CGHeroInstance.h"
#include "../VCMI_Lib.h" #include "../VCMI_Lib.h"
#include "CDrawRoadsOperation.h" #include "CDrawRoadsOperation.h"
#include "../mapping/CMap.h"
MapRect::MapRect() : x(0), y(0), z(0), width(0), height(0) MapRect::MapRect() : x(0), y(0), z(0), width(0), height(0)
{ {
+3 -1
View File
@@ -12,11 +12,13 @@
#pragma once #pragma once
#include "../CRandomGenerator.h" #include "../CRandomGenerator.h"
#include "CMap.h" #include "../int3.h"
#include "../GameConstants.h"
class CGObjectInstance; class CGObjectInstance;
class CTerrainViewPatternConfig; class CTerrainViewPatternConfig;
struct TerrainViewPattern; struct TerrainViewPattern;
class CMap;
/// Represents a map rectangle. /// Represents a map rectangle.
struct DLL_LINKAGE MapRect struct DLL_LINKAGE MapRect
+1
View File
@@ -13,6 +13,7 @@
#include "../CRandomGenerator.h" #include "../CRandomGenerator.h"
#include "CZonePlacer.h" #include "CZonePlacer.h"
#include "CRmgTemplateZone.h" #include "CRmgTemplateZone.h"
#include "../mapping/CMap.h"
#include "CZoneGraphGenerator.h" #include "CZoneGraphGenerator.h"
-2
View File
@@ -12,8 +12,6 @@
#pragma once #pragma once
#include "CMapGenerator.h" #include "CMapGenerator.h"
#include "../mapping/CMap.h"
#include "float3.h" #include "float3.h"
#include "../int3.h" #include "../int3.h"
+1
View File
@@ -18,6 +18,7 @@
#include "../BattleState.h" #include "../BattleState.h"
#include "../CGameState.h" #include "../CGameState.h"
#include "../CGameInfoCallback.h" #include "../CGameInfoCallback.h"
#include "../mapping/CMap.h"
///SummonBoatMechanics ///SummonBoatMechanics
ESpellCastResult SummonBoatMechanics::applyAdventureEffects(const SpellCastEnvironment * env, AdventureSpellCastParameters & parameters) const ESpellCastResult SummonBoatMechanics::applyAdventureEffects(const SpellCastEnvironment * env, AdventureSpellCastParameters & parameters) const
+1
View File
@@ -14,6 +14,7 @@
#include "../NetPacks.h" #include "../NetPacks.h"
#include "../BattleState.h" #include "../BattleState.h"
#include "../mapObjects/CGHeroInstance.h" #include "../mapObjects/CGHeroInstance.h"
#include "../mapObjects/CGTownInstance.h"
///HealingSpellMechanics ///HealingSpellMechanics
void HealingSpellMechanics::applyBattleEffects(const SpellCastEnvironment * env, const BattleSpellCastParameters & parameters, SpellCastContext & ctx) const void HealingSpellMechanics::applyBattleEffects(const SpellCastEnvironment * env, const BattleSpellCastParameters & parameters, SpellCastContext & ctx) const
+1
View File
@@ -2,6 +2,7 @@
#include "CQuery.h" #include "CQuery.h"
#include "CGameHandler.h" #include "CGameHandler.h"
#include "../lib/BattleState.h" #include "../lib/BattleState.h"
#include "../lib/mapObjects/MiscObjects.h"
boost::mutex Queries::mx; boost::mutex Queries::mx;