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

Reduced number of #include's in headers. May break compilation on Win

since some net packs now need DLL_LINKAGE
This commit is contained in:
Ivan Savenko 2014-06-25 17:11:07 +03:00
parent 3b0ecee678
commit 32240da34e
40 changed files with 241 additions and 159 deletions

View File

@ -5,6 +5,7 @@
#include "../../lib/mapObjects/MapObjects.h" #include "../../lib/mapObjects/MapObjects.h"
#include "../../lib/CConfigHandler.h" #include "../../lib/CConfigHandler.h"
#include "../../lib/CHeroHandler.h" #include "../../lib/CHeroHandler.h"
#include "../../lib/CModHandler.h"
/* /*

View File

@ -15,6 +15,7 @@
#include "../lib/VCMIDirs.h" #include "../lib/VCMIDirs.h"
#include "../lib/CSpellHandler.h" #include "../lib/CSpellHandler.h"
#include "../lib/CSoundBase.h" #include "../lib/CSoundBase.h"
#include "../lib/StartInfo.h"
#include "mapHandler.h" #include "mapHandler.h"
#include "GUIClasses.h" #include "GUIClasses.h"
#include "../lib/CConfigHandler.h" #include "../lib/CConfigHandler.h"

View File

@ -17,6 +17,7 @@
#include "../../lib/NetPacks.h" #include "../../lib/NetPacks.h"
#include "../../lib/CCreatureHandler.h" #include "../../lib/CCreatureHandler.h"
#include "../../lib/BattleState.h" #include "../../lib/BattleState.h"
#include "../../lib/StartInfo.h"
#include "../CMusicHandler.h" #include "../CMusicHandler.h"
#include "../CVideoHandler.h" #include "../CVideoHandler.h"
#include "../../lib/CTownHandler.h" #include "../../lib/CTownHandler.h"

View File

@ -365,13 +365,11 @@ BattleInfo * BattleInfo::setupBattle( int3 tile, ETerrainType terrain, BFieldTyp
if(town) if(town)
{ {
curB->town = town; curB->town = town;
curB->siege = town->fortLevel();
curB->terrainType = VLC->townh->factions[town->subID]->nativeTerrain; curB->terrainType = VLC->townh->factions[town->subID]->nativeTerrain;
} }
else else
{ {
curB->town = nullptr; curB->town = nullptr;
curB->siege = CGTownInstance::NONE;
curB->terrainType = terrain; curB->terrainType = terrain;
} }
@ -574,13 +572,13 @@ BattleInfo * BattleInfo::setupBattle( int3 tile, ETerrainType terrain, BFieldTyp
} }
if (curB->siege == CGTownInstance::CITADEL || curB->siege == CGTownInstance::CASTLE) if (curB->town && curB->town->fortLevel() >= CGTownInstance::CITADEL)
{ {
// keep tower // keep tower
CStack * stack = curB->generateNewStack(CStackBasicDescriptor(CreatureID::ARROW_TOWERS, 1), false, SlotID(255), -2); CStack * stack = curB->generateNewStack(CStackBasicDescriptor(CreatureID::ARROW_TOWERS, 1), false, SlotID(255), -2);
stacks.push_back(stack); stacks.push_back(stack);
if (curB->siege == CGTownInstance::CASTLE) if (curB->town->fortLevel() >= CGTownInstance::CASTLE)
{ {
// lower tower + upper tower // lower tower + upper tower
CStack * stack = curB->generateNewStack(CStackBasicDescriptor(CreatureID::ARROW_TOWERS, 1), false, SlotID(255), -4); CStack * stack = curB->generateNewStack(CStackBasicDescriptor(CreatureID::ARROW_TOWERS, 1), false, SlotID(255), -4);

View File

@ -4,8 +4,8 @@
#include "BattleHex.h" #include "BattleHex.h"
#include "HeroBonus.h" #include "HeroBonus.h"
#include "CCreatureSet.h" #include "CCreatureSet.h"
#include "mapObjects/CGTownInstance.h" #include "mapObjects/CArmedInstance.h" // for army serialization
#include "mapObjects/CGHeroInstance.h" #include "mapObjects/CGHeroInstance.h" // for commander serialization
#include "CCreatureHandler.h" #include "CCreatureHandler.h"
#include "CObstacleInstance.h" #include "CObstacleInstance.h"
#include "ConstTransitivePtr.h" #include "ConstTransitivePtr.h"
@ -83,8 +83,7 @@ struct DLL_LINKAGE BattleInfo : public CBonusSystemNode, public CBattleInfoCallb
{ {
std::array<SideInBattle, 2> sides; //sides[0] - attacker, sides[1] - defender std::array<SideInBattle, 2> sides; //sides[0] - attacker, sides[1] - defender
si32 round, activeStack, selectedStack; si32 round, activeStack, selectedStack;
CGTownInstance::EFortLevel siege; const CGTownInstance * town; //used during town siege, nullptr if this is not a siege (note that fortless town IS also a siege)
const CGTownInstance * town; //used during town siege - id of attacked town; -1 if not town defence
int3 tile; //for background and bonuses int3 tile; //for background and bonuses
std::vector<CStack*> stacks; std::vector<CStack*> stacks;
std::vector<shared_ptr<CObstacleInstance> > obstacles; std::vector<shared_ptr<CObstacleInstance> > obstacles;
@ -99,7 +98,7 @@ struct DLL_LINKAGE BattleInfo : public CBonusSystemNode, public CBattleInfoCallb
template <typename Handler> void serialize(Handler &h, const int version) template <typename Handler> void serialize(Handler &h, const int version)
{ {
h & sides; h & sides;
h & round & activeStack & selectedStack & siege & town & tile & stacks & obstacles h & round & activeStack & selectedStack & town & tile & stacks & obstacles
& si & battlefieldType & terrainType; & si & battlefieldType & terrainType;
h & tacticsSide & tacticDistance; h & tacticsSide & tacticDistance;
h & static_cast<CBonusSystemNode&>(*this); h & static_cast<CBonusSystemNode&>(*this);

View File

@ -2,8 +2,8 @@
#include "../lib/HeroBonus.h" #include "../lib/HeroBonus.h"
#include "../lib/ConstTransitivePtr.h" //#include "../lib/ConstTransitivePtr.h"
#include "JsonNode.h" //#include "JsonNode.h"
#include "GameConstants.h" #include "GameConstants.h"
#include "IHandlerBase.h" #include "IHandlerBase.h"

View File

@ -409,7 +409,7 @@ ui8 CBattleInfoEssentials::playerToSide(PlayerColor player) const
ui8 CBattleInfoEssentials::battleGetSiegeLevel() const ui8 CBattleInfoEssentials::battleGetSiegeLevel() const
{ {
RETURN_IF_NOT_BATTLE(0); RETURN_IF_NOT_BATTLE(0);
return getBattle()->siege; return getBattle()->town ? getBattle()->town->fortLevel() : CGTownInstance::NONE;
} }
bool CBattleInfoEssentials::battleCanSurrender(PlayerColor player) const bool CBattleInfoEssentials::battleCanSurrender(PlayerColor player) const
@ -429,7 +429,7 @@ bool CBattleInfoEssentials::battleHasHero(ui8 side) const
si8 CBattleInfoEssentials::battleGetWallState(int partOfWall) const si8 CBattleInfoEssentials::battleGetWallState(int partOfWall) const
{ {
RETURN_IF_NOT_BATTLE(0); RETURN_IF_NOT_BATTLE(0);
if(getBattle()->siege == CGTownInstance::NONE) if(getBattle()->town == nullptr || getBattle()->town->fortLevel() == CGTownInstance::NONE)
return EWallState::NONE; return EWallState::NONE;
assert(partOfWall >= 0 && partOfWall < EWallPart::PARTS_COUNT); assert(partOfWall >= 0 && partOfWall < EWallPart::PARTS_COUNT);

View File

@ -16,6 +16,7 @@
#include "StartInfo.h" // for StartInfo #include "StartInfo.h" // for StartInfo
#include "BattleState.h" // for BattleInfo #include "BattleState.h" // for BattleInfo
#include "NetPacks.h" // for InfoWindow #include "NetPacks.h" // for InfoWindow
#include "CModHandler.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)

View File

@ -3509,59 +3509,6 @@ CPathfinder::CPathfinder(CPathsInfo &_out, CGameState *_gs, const CGHeroInstance
allowEmbarkAndDisembark = true; allowEmbarkAndDisembark = true;
} }
EVictoryLossCheckResult::EVictoryLossCheckResult() :
intValue(0)
{
}
EVictoryLossCheckResult::EVictoryLossCheckResult(si32 intValue, std::string toSelf, std::string toOthers) :
messageToSelf(toSelf),
messageToOthers(toOthers),
intValue(intValue)
{
}
bool EVictoryLossCheckResult::operator==(EVictoryLossCheckResult const & other) const
{
return intValue == other.intValue;
}
bool EVictoryLossCheckResult::operator!=(EVictoryLossCheckResult const & other) const
{
return intValue != other.intValue;
}
bool EVictoryLossCheckResult::victory() const
{
return intValue == VICTORY;
}
bool EVictoryLossCheckResult::loss() const
{
return intValue == DEFEAT;
}
EVictoryLossCheckResult EVictoryLossCheckResult::invert()
{
return EVictoryLossCheckResult(-intValue, messageToOthers, messageToSelf);
}
EVictoryLossCheckResult EVictoryLossCheckResult::victory(std::string toSelf, std::string toOthers)
{
return EVictoryLossCheckResult(VICTORY, toSelf, toOthers);
}
EVictoryLossCheckResult EVictoryLossCheckResult::defeat(std::string toSelf, std::string toOthers)
{
return EVictoryLossCheckResult(DEFEAT, toSelf, toOthers);
}
std::ostream & operator<<(std::ostream & os, const EVictoryLossCheckResult & victoryLossCheckResult)
{
os << victoryLossCheckResult.messageToSelf;
return os;
}
CRandomGenerator & CGameState::getRandomGenerator() CRandomGenerator & CGameState::getRandomGenerator()
{ {
return rand; return rand;

View File

@ -15,6 +15,7 @@
#include "ResourceSet.h" #include "ResourceSet.h"
#include "int3.h" #include "int3.h"
#include "CRandomGenerator.h" #include "CRandomGenerator.h"
#include "CGameStateFwd.h"
/* /*
* CGameState.h, part of VCMI engine * CGameState.h, part of VCMI engine
@ -355,39 +356,6 @@ public:
struct BattleInfo; struct BattleInfo;
class DLL_LINKAGE EVictoryLossCheckResult
{
public:
static EVictoryLossCheckResult victory(std::string toSelf, std::string toOthers);
static EVictoryLossCheckResult defeat(std::string toSelf, std::string toOthers);
EVictoryLossCheckResult();
bool operator==(EVictoryLossCheckResult const & other) const;
bool operator!=(EVictoryLossCheckResult const & other) const;
bool victory() const;
bool loss() const;
EVictoryLossCheckResult invert();
std::string messageToSelf;
std::string messageToOthers;
template <typename Handler> void serialize(Handler &h, const int version)
{
h & intValue & messageToSelf & messageToOthers;
}
private:
enum EResult
{
DEFEAT = -1,
INGAME = 0,
VICTORY= +1
};
EVictoryLossCheckResult(si32 intValue, std::string toSelf, std::string toOthers);
si32 intValue; // uses EResult
};
DLL_LINKAGE std::ostream & operator<<(std::ostream & os, const EVictoryLossCheckResult & victoryLossCheckResult); DLL_LINKAGE std::ostream & operator<<(std::ostream & os, const EVictoryLossCheckResult & victoryLossCheckResult);
class DLL_LINKAGE CGameState : public CNonConstInfoCallback class DLL_LINKAGE CGameState : public CNonConstInfoCallback
@ -533,35 +501,3 @@ private:
friend class CMapHandler; friend class CMapHandler;
friend class CGameHandler; friend class CGameHandler;
}; };
struct DLL_LINKAGE QuestInfo //universal interface for human and AI
{
const CQuest * quest;
const CGObjectInstance * obj; //related object, most likely Seer Hut
int3 tile;
QuestInfo(){};
QuestInfo (const CQuest * Quest, const CGObjectInstance * Obj, int3 Tile) :
quest (Quest), obj (Obj), tile (Tile){};
//FIXME: assignment operator should return QuestInfo &
bool operator= (const QuestInfo &qi)
{
quest = qi.quest;
obj = qi.obj;
tile = qi.tile;
return true;
}
bool operator== (const QuestInfo & qi) const
{
return (quest == qi.quest && obj == qi.obj);
}
//std::vector<std::string> > texts //allow additional info for quest log?
template <typename Handler> void serialize(Handler &h, const int version)
{
h & quest & obj & tile;
}
};

120
lib/CGameStateFwd.h Normal file
View File

@ -0,0 +1,120 @@
#pragma once
/*
* CGameStateFwd.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
*
*/
class CQuest;
class CGObjectInstance;
class DLL_LINKAGE EVictoryLossCheckResult
{
public:
static EVictoryLossCheckResult victory(std::string toSelf, std::string toOthers)
{
return EVictoryLossCheckResult(VICTORY, toSelf, toOthers);
}
static EVictoryLossCheckResult defeat(std::string toSelf, std::string toOthers)
{
return EVictoryLossCheckResult(DEFEAT, toSelf, toOthers);
}
EVictoryLossCheckResult():
intValue(0)
{
}
bool operator==(EVictoryLossCheckResult const & other) const
{
return intValue == other.intValue;
}
bool operator!=(EVictoryLossCheckResult const & other) const
{
return intValue != other.intValue;
}
bool victory() const
{
return intValue == VICTORY;
}
bool loss() const
{
return intValue == DEFEAT;
}
EVictoryLossCheckResult invert()
{
return EVictoryLossCheckResult(-intValue, messageToOthers, messageToSelf);
}
std::string messageToSelf;
std::string messageToOthers;
template <typename Handler> void serialize(Handler &h, const int version)
{
h & intValue & messageToSelf & messageToOthers;
}
private:
enum EResult
{
DEFEAT = -1,
INGAME = 0,
VICTORY= +1
};
EVictoryLossCheckResult(si32 intValue, std::string toSelf, std::string toOthers):
messageToSelf(toSelf),
messageToOthers(toOthers),
intValue(intValue)
{
}
si32 intValue; // uses EResult
};
/*static std::ostream & operator<<(std::ostream & os, const EVictoryLossCheckResult & victoryLossCheckResult)
{
os << victoryLossCheckResult.messageToSelf;
return os;
}*/
struct DLL_LINKAGE QuestInfo //universal interface for human and AI
{
const CQuest * quest;
const CGObjectInstance * obj; //related object, most likely Seer Hut
int3 tile;
QuestInfo(){};
QuestInfo (const CQuest * Quest, const CGObjectInstance * Obj, int3 Tile) :
quest (Quest), obj (Obj), tile (Tile){};
//FIXME: assignment operator should return QuestInfo &
bool operator= (const QuestInfo &qi)
{
quest = qi.quest;
obj = qi.obj;
tile = qi.tile;
return true;
}
bool operator== (const QuestInfo & qi) const
{
return (quest == qi.quest && obj == qi.obj);
}
//std::vector<std::string> > texts //allow additional info for quest log?
template <typename Handler> void serialize(Handler &h, const int version)
{
h & quest & obj & tile;
}
};

View File

@ -82,6 +82,7 @@ set(lib_SRCS
ResourceSet.cpp ResourceSet.cpp
VCMI_Lib.cpp VCMI_Lib.cpp
VCMIDirs.cpp VCMIDirs.cpp
IHandlerBase.cpp
IGameCallback.cpp IGameCallback.cpp
CGameInfoCallback.cpp CGameInfoCallback.cpp
@ -118,8 +119,8 @@ set(lib_HEADERS
GameConstants.h GameConstants.h
StringConstants.h StringConstants.h
IGameEventsReceiver.h IGameEventsReceiver.h
IHandlerBase.h
int3.h int3.h
CGameStateFwd.h
Interprocess.h Interprocess.h
NetPacks.h NetPacks.h
NetPacksBase.h NetPacksBase.h

View File

@ -15,9 +15,12 @@
#include "CSpellHandler.h" // for CSpell #include "CSpellHandler.h" // for CSpell
#include "NetPacks.h" #include "NetPacks.h"
#include "CBonusTypeHandler.h" #include "CBonusTypeHandler.h"
#include "CModHandler.h"
#include "Connection.h" // for SAVEGAME_MAGIC #include "Connection.h" // for SAVEGAME_MAGIC
#include "mapObjects/CObjectClassesHandler.h" #include "mapObjects/CObjectClassesHandler.h"
#include "StartInfo.h"
#include "CGameState.h"
void CPrivilagedInfoCallback::getFreeTiles (std::vector<int3> &tiles) const void CPrivilagedInfoCallback::getFreeTiles (std::vector<int3> &tiles) const
{ {

19
lib/IHandlerBase.cpp Normal file
View File

@ -0,0 +1,19 @@
/*
* IHandlerBase.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 "IHandlerBase.h"
#include "CModHandler.h"
void IHandlerBase::registerObject(std::string scope, std::string type_name, std::string name, si32 index)
{
return VLC->modh->identifiers.registerObject(scope, type_name, name, index);
}

View File

@ -11,7 +11,7 @@
*/ */
#include "../lib/ConstTransitivePtr.h" #include "../lib/ConstTransitivePtr.h"
#include "VCMI_Lib.h" #include "VCMI_Lib.h"
#include "CModHandler.h" //#include "CModHandler.h"
class JsonNode; class JsonNode;
@ -22,6 +22,9 @@ class DLL_LINKAGE IHandlerBase
// Object * loadFromJson(const JsonNode & json); // Object * loadFromJson(const JsonNode & json);
// where Object is type of data loaded by handler // where Object is type of data loaded by handler
// primary used in loadObject methods // primary used in loadObject methods
protected:
/// Calls modhandler. Mostly needed to avoid large number of includes in headers
void registerObject(std::string scope, std::string type_name, std::string name, si32 index);
public: public:
/// loads all original game data in vector of json nodes /// loads all original game data in vector of json nodes
@ -48,7 +51,6 @@ public:
virtual ~IHandlerBase(){} virtual ~IHandlerBase(){}
}; };
template <class _ObjectID, class _Object> class CHandlerBase: public IHandlerBase template <class _ObjectID, class _Object> class CHandlerBase: public IHandlerBase
{ {
public: public:
@ -68,7 +70,7 @@ public:
objects.push_back(object); objects.push_back(object);
VLC->modh->identifiers.registerObject(scope, type_name, name, object->id); registerObject(scope, type_name, name, object->id);
} }
void loadObject(std::string scope, std::string name, const JsonNode & data, size_t index) override void loadObject(std::string scope, std::string name, const JsonNode & data, size_t index) override
{ {
@ -80,7 +82,7 @@ public:
assert(objects[index] == nullptr); // ensure that this id was not loaded before assert(objects[index] == nullptr); // ensure that this id was not loaded before
objects[index] = object; objects[index] = object;
VLC->modh->identifiers.registerObject(scope,type_name, name, object->id); registerObject(scope,type_name, name, object->id);
} }

View File

@ -3,16 +3,18 @@
#include "NetPacksBase.h" #include "NetPacksBase.h"
#include "BattleAction.h" #include "BattleAction.h"
#include "HeroBonus.h" //#include "HeroBonus.h"
#include "mapObjects/CGHeroInstance.h" #include "mapObjects/CGHeroInstance.h"
#include "CCreatureSet.h" //#include "CCreatureSet.h"
#include "mapping/CMapInfo.h" //#include "mapping/CMapInfo.h"
#include "StartInfo.h" //#include "StartInfo.h"
#include "ConstTransitivePtr.h" #include "ConstTransitivePtr.h"
#include "int3.h" #include "int3.h"
#include "ResourceSet.h" #include "ResourceSet.h"
//#include "CObstacleInstance.h"
#include "CGameStateFwd.h"
#include "mapping/CMap.h"
#include "CObstacleInstance.h" #include "CObstacleInstance.h"
#include "CGameState.h"
/* /*
* NetPacks.h, part of VCMI engine * NetPacks.h, part of VCMI engine
@ -37,7 +39,8 @@ class CArtifactInstance;
struct StackLocation; struct StackLocation;
struct ArtSlotInfo; struct ArtSlotInfo;
struct QuestInfo; struct QuestInfo;
class CMapInfo;
class StartInfo;
struct CPackForClient : public CPack struct CPackForClient : public CPack
@ -2127,7 +2130,7 @@ struct PlayerJoined : public CPregamePackToHost
} }
}; };
struct SelectMap : public CPregamePackToPropagate struct DLL_LINKAGE SelectMap : public CPregamePackToPropagate
{ {
const CMapInfo *mapInfo; const CMapInfo *mapInfo;
bool free; bool free;
@ -2142,11 +2145,7 @@ struct SelectMap : public CPregamePackToPropagate
mapInfo = nullptr; mapInfo = nullptr;
free = true; free = true;
} }
~SelectMap() DLL_LINKAGE ~SelectMap();
{
if(free)
delete mapInfo;
}
void apply(CSelectionScreen *selScreen); //that functions are implemented in CPreGame.cpp void apply(CSelectionScreen *selScreen); //that functions are implemented in CPreGame.cpp
@ -2157,7 +2156,7 @@ struct SelectMap : public CPregamePackToPropagate
}; };
struct UpdateStartOptions : public CPregamePackToPropagate struct DLL_LINKAGE UpdateStartOptions : public CPregamePackToPropagate
{ {
StartInfo *options; StartInfo *options;
bool free; bool free;
@ -2174,11 +2173,7 @@ struct UpdateStartOptions : public CPregamePackToPropagate
options = nullptr; options = nullptr;
free = true; free = true;
} }
~UpdateStartOptions() DLL_LINKAGE ~UpdateStartOptions();
{
if(free)
delete options;
}
template <typename Handler> void serialize(Handler &h, const int version) template <typename Handler> void serialize(Handler &h, const int version)
{ {

View File

@ -14,6 +14,8 @@
#include "CGameState.h" #include "CGameState.h"
#include "BattleState.h" #include "BattleState.h"
#include "CTownHandler.h" #include "CTownHandler.h"
#include "mapping/CMapInfo.h"
#include "StartInfo.h"
/* /*
* NetPacksLib.cpp, part of VCMI engine * NetPacksLib.cpp, part of VCMI engine
@ -60,6 +62,18 @@ DLL_LINKAGE void SetSecSkill::applyGs( CGameState *gs )
hero->setSecSkillLevel(which, val, abs); hero->setSecSkillLevel(which, val, abs);
} }
DLL_LINKAGE SelectMap::~SelectMap()
{
if(free)
delete mapInfo;
}
DLL_LINKAGE UpdateStartOptions::~UpdateStartOptions()
{
if(free)
delete options;
}
DLL_LINKAGE void SetCommanderProperty::applyGs(CGameState *gs) DLL_LINKAGE void SetCommanderProperty::applyGs(CGameState *gs)
{ {
CCommanderInstance * commander = gs->getHero(heroid)->commander; CCommanderInstance * commander = gs->getHero(heroid)->commander;
@ -1501,7 +1515,7 @@ DLL_LINKAGE CatapultAttack::~CatapultAttack()
DLL_LINKAGE void CatapultAttack::applyGs( CGameState *gs ) DLL_LINKAGE void CatapultAttack::applyGs( CGameState *gs )
{ {
if(gs->curB && gs->curB->siege != CGTownInstance::NONE) //if there is a battle and it's a siege if(gs->curB && gs->curB->town && gs->curB->town->fortLevel() != CGTownInstance::NONE) //if there is a battle and it's a siege
{ {
for(const auto &it :attackedParts) for(const auto &it :attackedParts)
{ {

View File

@ -13,6 +13,9 @@
* *
*/ */
class BattleInfo;
class CGameState;
class DLL_LINKAGE CArmedInstance: public CGObjectInstance, public CBonusSystemNode, public CCreatureSet class DLL_LINKAGE CArmedInstance: public CGObjectInstance, public CBonusSystemNode, public CCreatureSet
{ {
public: public:

View File

@ -16,6 +16,8 @@
#include "../CSoundBase.h" #include "../CSoundBase.h"
#include "CommonConstructors.h" #include "CommonConstructors.h"
#include "../CSpellHandler.h" #include "../CSpellHandler.h"
#include "../IGameCallback.h"
#include "../CGameState.h"
using namespace boost::assign; using namespace boost::assign;

View File

@ -14,10 +14,13 @@
#include "../NetPacks.h" #include "../NetPacks.h"
#include "../CGeneralTextHandler.h" #include "../CGeneralTextHandler.h"
#include "../CHeroHandler.h" #include "../CHeroHandler.h"
#include "../CModHandler.h"
#include "../CSoundBase.h" #include "../CSoundBase.h"
#include "../CSpellHandler.h" #include "../CSpellHandler.h"
#include "CObjectClassesHandler.h" #include "CObjectClassesHandler.h"
#include "../IGameCallback.h"
#include "../CGameState.h"
#include "../CCreatureHandler.h"
using namespace boost::assign; using namespace boost::assign;

View File

@ -18,6 +18,8 @@
class CHero; class CHero;
class CGBoat; class CGBoat;
class CGTownInstance;
class TerrainTile;
class CGHeroPlaceholder : public CGObjectInstance class CGHeroPlaceholder : public CGObjectInstance
{ {

View File

@ -14,6 +14,9 @@
#include "../NetPacks.h" #include "../NetPacks.h"
#include "../CGeneralTextHandler.h" #include "../CGeneralTextHandler.h"
#include "../IGameCallback.h"
#include "../CCreatureHandler.h"
#include "../CGameState.h"
using namespace boost::assign; using namespace boost::assign;

View File

@ -15,6 +15,8 @@
#include "../CSoundBase.h" #include "../CSoundBase.h"
#include "../CSpellHandler.h" #include "../CSpellHandler.h"
#include "../StartInfo.h"
#include "../IGameCallback.h"
using namespace boost::assign; using namespace boost::assign;

View File

@ -2,6 +2,7 @@
#include "CObjectHandler.h" #include "CObjectHandler.h"
#include "CArmedInstance.h" #include "CArmedInstance.h"
#include "../ResourceSet.h"
/* /*
* CGPandoraBox.h, part of VCMI engine * CGPandoraBox.h, part of VCMI engine
@ -13,6 +14,8 @@
* *
*/ */
class InfoWindow;
class DLL_LINKAGE CGPandoraBox : public CArmedInstance class DLL_LINKAGE CGPandoraBox : public CArmedInstance
{ {
public: public:

View File

@ -14,6 +14,9 @@
#include "../NetPacks.h" #include "../NetPacks.h"
#include "../CGeneralTextHandler.h" #include "../CGeneralTextHandler.h"
#include "../CModHandler.h"
#include "../IGameCallback.h"
#include "../CGameState.h"
using namespace boost::assign; using namespace boost::assign;

View File

@ -17,6 +17,7 @@
*/ */
class CCastleEvent; class CCastleEvent;
class CGTownInstance;
class DLL_LINKAGE CSpecObjInfo class DLL_LINKAGE CSpecObjInfo
{ {

View File

@ -5,6 +5,7 @@
#include "../GameConstants.h" #include "../GameConstants.h"
#include "../ConstTransitivePtr.h" #include "../ConstTransitivePtr.h"
#include "../IHandlerBase.h" #include "../IHandlerBase.h"
#include "../JsonNode.h"
/* /*
* CObjectClassesHandler.h, part of VCMI engine * CObjectClassesHandler.h, part of VCMI engine

View File

@ -15,6 +15,9 @@
#include "../CGeneralTextHandler.h" #include "../CGeneralTextHandler.h"
#include "../CHeroHandler.h" #include "../CHeroHandler.h"
#include "../CSoundBase.h" #include "../CSoundBase.h"
#include "../filesystem/ResourceID.h"
#include "../IGameCallback.h"
#include "../CGameState.h"
#include "CObjectClassesHandler.h" #include "CObjectClassesHandler.h"

View File

@ -2,7 +2,7 @@
#include "ObjectTemplate.h" #include "ObjectTemplate.h"
#include "../IGameCallback.h" //#include "../IGameCallback.h"
#include "../int3.h" #include "../int3.h"
#include "../HeroBonus.h" #include "../HeroBonus.h"
@ -17,6 +17,9 @@
*/ */
class CGHeroInstance; class CGHeroInstance;
class IGameCallback;
class CGObjectInstance;
class MetaString;
struct BattleResult; struct BattleResult;
class DLL_LINKAGE IObjectInterface class DLL_LINKAGE IObjectInterface

View File

@ -17,6 +17,8 @@
#include "../CGeneralTextHandler.h" #include "../CGeneralTextHandler.h"
#include "../CHeroHandler.h" #include "../CHeroHandler.h"
#include "CObjectClassesHandler.h" #include "CObjectClassesHandler.h"
#include "../IGameCallback.h"
#include "../CGameState.h"
using namespace boost::assign; using namespace boost::assign;

View File

@ -16,6 +16,8 @@
* *
*/ */
class CGCreature;
class DLL_LINKAGE CQuest class DLL_LINKAGE CQuest
{ {
public: public:

View File

@ -5,6 +5,7 @@
#include "../StringConstants.h" #include "../StringConstants.h"
#include "../CCreatureHandler.h" #include "../CCreatureHandler.h"
#include "JsonRandom.h" #include "JsonRandom.h"
#include "../IGameCallback.h"
/* /*
* CRewardableConstructor.cpp, part of VCMI engine * CRewardableConstructor.cpp, part of VCMI engine

View File

@ -15,6 +15,8 @@
#include "../CGeneralTextHandler.h" #include "../CGeneralTextHandler.h"
#include "../CSoundBase.h" #include "../CSoundBase.h"
#include "../NetPacks.h" #include "../NetPacks.h"
#include "../IGameCallback.h"
#include "../CGameState.h"
#include "CObjectClassesHandler.h" #include "CObjectClassesHandler.h"

View File

@ -4,6 +4,7 @@
#include "CArmedInstance.h" #include "CArmedInstance.h"
#include "../NetPacksBase.h" #include "../NetPacksBase.h"
#include "../ResourceSet.h"
/* /*
* CRewardableObject.h, part of VCMI engine * CRewardableObject.h, part of VCMI engine

View File

@ -8,6 +8,8 @@
#include "../CHeroHandler.h" #include "../CHeroHandler.h"
#include "../CCreatureHandler.h" #include "../CCreatureHandler.h"
#include "JsonRandom.h" #include "JsonRandom.h"
#include "../CModHandler.h"
#include "../IGameCallback.h"
/* /*
* CommonConstructors.cpp, part of VCMI engine * CommonConstructors.cpp, part of VCMI engine

View File

@ -14,9 +14,12 @@
#include "../NetPacks.h" #include "../NetPacks.h"
#include "../CGeneralTextHandler.h" #include "../CGeneralTextHandler.h"
#include "../CSoundBase.h" #include "../CSoundBase.h"
#include "../CModHandler.h"
#include "CObjectClassesHandler.h" #include "CObjectClassesHandler.h"
#include "../CSpellHandler.h" #include "../CSpellHandler.h"
#include "../IGameCallback.h"
#include "../CGameState.h"
using namespace boost::assign; using namespace boost::assign;

View File

@ -2,6 +2,7 @@
#include "CObjectHandler.h" #include "CObjectHandler.h"
#include "CArmedInstance.h" #include "CArmedInstance.h"
#include "../ResourceSet.h"
/* /*
* MiscObjects.h, part of VCMI engine * MiscObjects.h, part of VCMI engine

View File

@ -12,6 +12,7 @@
#include "../mapObjects/CRewardableConstructor.h" #include "../mapObjects/CRewardableConstructor.h"
#include "../mapObjects/CommonConstructors.h" #include "../mapObjects/CommonConstructors.h"
#include "../mapObjects/MapObjects.h" #include "../mapObjects/MapObjects.h"
#include "../CObstacleInstance.h"
/* /*
* RegisterTypes.h, part of VCMI engine * RegisterTypes.h, part of VCMI engine

View File

@ -5225,7 +5225,7 @@ void CGameHandler::checkVictoryLossConditionsForPlayer(PlayerColor player)
} }
} }
void CGameHandler::getVictoryLossMessage(PlayerColor player, EVictoryLossCheckResult victoryLossCheckResult, InfoWindow & out) const void CGameHandler::getVictoryLossMessage(PlayerColor player, const EVictoryLossCheckResult & victoryLossCheckResult, InfoWindow & out) const
{ {
out.player = player; out.player = player;
out.text.clear(); out.text.clear();

View File

@ -290,7 +290,7 @@ public:
private: private:
std::list<PlayerColor> generatePlayerTurnOrder() const; std::list<PlayerColor> generatePlayerTurnOrder() const;
void makeStackDoNothing(const CStack * next); void makeStackDoNothing(const CStack * next);
void getVictoryLossMessage(PlayerColor player, EVictoryLossCheckResult victoryLossCheckResult, InfoWindow & out) const; void getVictoryLossMessage(PlayerColor player, const EVictoryLossCheckResult & victoryLossCheckResult, InfoWindow & out) const;
// Check for victory and loss conditions // Check for victory and loss conditions
void checkVictoryLossConditionsForPlayer(PlayerColor player); void checkVictoryLossConditionsForPlayer(PlayerColor player);