1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-02 09:02:03 +02:00

wrap all library code into namespace if VCMI_LIB_NAMESPACE is defined

preparation for having client and server in a single process
This commit is contained in:
Andrey Filipenkov 2022-07-26 16:07:42 +03:00
parent 1319c8f197
commit ff635edc0b
467 changed files with 2117 additions and 211 deletions

View File

@ -13,7 +13,12 @@
#include "PossibleSpellcast.h"
#include "PotentialTargets.h"
VCMI_LIB_NAMESPACE_BEGIN
class CSpell;
VCMI_LIB_NAMESPACE_END
class EnemyInfo;
/*

View File

@ -9,11 +9,15 @@
*/
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
namespace battle
{
class Unit;
}
VCMI_LIB_NAMESPACE_END
class EnemyInfo
{
public:

View File

@ -14,8 +14,12 @@
#include "../../lib/battle/Destination.h"
VCMI_LIB_NAMESPACE_BEGIN
class CSpell;
VCMI_LIB_NAMESPACE_END
class PossibleSpellcast
{
public:

View File

@ -18,9 +18,14 @@
#include "../../lib/battle/BattleProxy.h"
#include "../../lib/battle/CUnitState.h"
class HypotheticBattle;
VCMI_LIB_NAMESPACE_BEGIN
class CStack;
VCMI_LIB_NAMESPACE_END
class HypotheticBattle;
///Fake random generator, used by AI to evaluate random server behavior
class RNGStub : public vstd::RNG
{

View File

@ -13,3 +13,5 @@
// This header should be treated as a pre compiled header file(PCH) in the compiler building settings.
// Here you can add specific libraries and macros which are specific to this project.
VCMI_LIB_USING_NAMESPACE

View File

@ -25,8 +25,12 @@
#include "Pathfinding/AIPathfinder.h"
#include "Engine/Nullkiller.h"
VCMI_LIB_NAMESPACE_BEGIN
struct QuestInfo;
VCMI_LIB_NAMESPACE_END
class AIStatus
{
boost::mutex mx;

View File

@ -11,8 +11,12 @@
#include <fl/Headers.h>
#include "../Goals/AbstractGoal.h"
VCMI_LIB_NAMESPACE_BEGIN
class CArmedInstance;
VCMI_LIB_NAMESPACE_END
class engineBase //subclasses create fuzzylite variables with "new" that are not freed - this is desired as fl::Engine wants to destroy these...
{
protected:

View File

@ -10,7 +10,12 @@
#pragma once
#include "FuzzyEngines.h"
VCMI_LIB_NAMESPACE_BEGIN
class CBank;
VCMI_LIB_NAMESPACE_END
class Nullkiller;
class DLL_EXPORT FuzzyHelper

View File

@ -12,9 +12,14 @@
#include "../Goals/CGoal.h"
#include "../Pathfinding/AIPathfinder.h"
VCMI_LIB_NAMESPACE_BEGIN
class CGWitchHut;
VCMI_LIB_NAMESPACE_END
class BuildingInfo;
class Nullkiller;
class CGWitchHut;
class RewardEvaluator
{

View File

@ -164,6 +164,7 @@ ExchangeResult ChainActor::tryExchangeNoLock(const ChainActor * specialActor, co
return baseActor->tryExchangeNoLock(specialActor, other);
}
VCMI_LIB_NAMESPACE_BEGIN
namespace vstd
{
template <class M, class Key, class F>
@ -180,6 +181,7 @@ namespace vstd
return v;
}
}
VCMI_LIB_NAMESPACE_END
ExchangeResult HeroActor::tryExchangeNoLock(const ChainActor * specialActor, const ChainActor * other) const
{

View File

@ -1,3 +1,4 @@
#pragma once
#include "../../Global.h"
VCMI_LIB_USING_NAMESPACE
#include "../../CCallback.h"

View File

@ -4,4 +4,6 @@
// This header should be treated as a pre compiled header file(PCH) in the compiler building settings.
// Here you can add specific libraries and macros which are specific to this project.
// Here you can add specific libraries and macros which are specific to this project.
VCMI_LIB_USING_NAMESPACE

View File

@ -11,8 +11,12 @@
#include <fl/Headers.h>
#include "Goals/AbstractGoal.h"
VCMI_LIB_NAMESPACE_BEGIN
class CArmedInstance;
VCMI_LIB_NAMESPACE_END
class engineBase //subclasses create fuzzylite variables with "new" that are not freed - this is desired as fl::Engine wants to destroy these...
{
protected:

View File

@ -10,8 +10,12 @@
#pragma once
#include "FuzzyEngines.h"
VCMI_LIB_NAMESPACE_BEGIN
class CBank;
VCMI_LIB_NAMESPACE_END
class DLL_EXPORT FuzzyHelper
{
public:

View File

@ -1,2 +1,4 @@
#pragma once
#include "../../Global.h"
VCMI_LIB_USING_NAMESPACE

View File

@ -29,8 +29,12 @@
extern FuzzyHelper * fh;
VCMI_LIB_NAMESPACE_BEGIN
class CGVisitableOPW;
VCMI_LIB_NAMESPACE_END
const double SAFE_ATTACK_CONSTANT = 1.5;
//one thread may be turn of AI and another will be handling a side effect for AI2

View File

@ -26,8 +26,12 @@
#include "../../lib/CondSh.h"
#include "Pathfinding/AIPathfinder.h"
VCMI_LIB_NAMESPACE_BEGIN
struct QuestInfo;
VCMI_LIB_NAMESPACE_END
class AIhelper;
class AIStatus

View File

@ -13,6 +13,8 @@
#include "lib/battle/CPlayerBattleCallback.h"
#include "lib/int3.h" // for int3
VCMI_LIB_NAMESPACE_BEGIN
class CGHeroInstance;
class CGameState;
struct CPath;
@ -20,18 +22,22 @@ class CGObjectInstance;
class CArmedInstance;
class BattleAction;
class CGTownInstance;
struct lua_State;
class CClient;
class IShipyard;
struct CGPathNode;
struct CGPath;
struct CPathsInfo;
class PathfinderConfig;
struct CPack;
struct CPackForServer;
class IBattleEventsReceiver;
class IGameEventsReceiver;
struct ArtifactLocation;
VCMI_LIB_NAMESPACE_END
class CClient;
struct lua_State;
class IBattleCallback
{
public:
@ -88,8 +94,6 @@ public:
virtual int bulkMergeStacks(ObjectInstanceID armyId, SlotID srcSlot) = 0;
};
struct CPackForServer;
class CBattleCallback : public IBattleCallback, public CPlayerBattleCallback
{
protected:

View File

@ -264,11 +264,26 @@ template<typename T, size_t N> char (&_ArrayCountObj(const T (&)[N]))[N];
// should be used for variables that becomes unused in release builds (e.g. only used for assert checks)
#define UNUSED(VAR) ((void)VAR)
// single-process build makes 2 copies of the main lib by wrapping it in a namespace
#ifdef VCMI_LIB_NAMESPACE
#define VCMI_LIB_NAMESPACE_BEGIN namespace VCMI_LIB_NAMESPACE {
#define VCMI_LIB_NAMESPACE_END }
#define VCMI_LIB_USING_NAMESPACE using namespace VCMI_LIB_NAMESPACE;
#define VCMI_LIB_WRAP_NAMESPACE(x) VCMI_LIB_NAMESPACE::x
#else
#define VCMI_LIB_NAMESPACE_BEGIN
#define VCMI_LIB_NAMESPACE_END
#define VCMI_LIB_USING_NAMESPACE
#define VCMI_LIB_WRAP_NAMESPACE(x) x
#endif
/* ---------------------------------------------------------------------------- */
/* VCMI standard library */
/* ---------------------------------------------------------------------------- */
#include <vstd/CLoggerBase.h>
VCMI_LIB_NAMESPACE_BEGIN
void inline handleException()
{
try
@ -739,3 +754,5 @@ namespace std
}
}
#endif // NO_STD_TOSTRING
VCMI_LIB_NAMESPACE_END

View File

@ -9,7 +9,11 @@
*/
#include "Version.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace GameConstants
{
const char GIT_SHA1[] = "@GIT_SHA1@";
}
VCMI_LIB_NAMESPACE_END

View File

@ -1,6 +1,10 @@
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
namespace GameConstants
{
extern const char GIT_SHA1[];
}
VCMI_LIB_NAMESPACE_END

View File

@ -13,29 +13,33 @@
#include "../lib/ConstTransitivePtr.h"
VCMI_LIB_NAMESPACE_BEGIN
class CModHandler;
class CMapHandler;
class CHeroHandler;
class CCreatureHandler;
class CSpellHandler;
class CSkillHandler;
class CBuildingHandler;
class CObjectHandler;
class CSoundHandler;
class CMusicHandler;
class CObjectClassesHandler;
class CTownHandler;
class CGeneralTextHandler;
class CConsoleHandler;
class CCursorHandler;
class CGameState;
class IMainVideoPlayer;
class CServerHandler;
class BattleFieldHandler;
class ObstacleHandler;
class CMap;
VCMI_LIB_NAMESPACE_END
class CMapHandler;
class CSoundHandler;
class CMusicHandler;
class CCursorHandler;
class IMainVideoPlayer;
class CServerHandler;
//a class for non-mechanical client GUI classes
class CClientState

View File

@ -19,30 +19,33 @@
#define sprintf_s snprintf
#endif
VCMI_LIB_NAMESPACE_BEGIN
class Artifact;
struct TryMoveHero;
class CGHeroInstance;
class CStack;
class CCreature;
struct CGPath;
class CCreatureSet;
class CGObjectInstance;
struct UpgradeInfo;
template <typename T> struct CondSh;
struct CPathsInfo;
VCMI_LIB_NAMESPACE_END
class CButton;
class CToggleGroup;
struct TryMoveHero;
class CGHeroInstance;
class CAdvMapInt;
class CCastleInterface;
class CBattleInterface;
class CStack;
class CComponent;
class CCreature;
struct SDL_Surface;
struct CGPath;
class CCreatureAnimation;
class CSelectableComponent;
class CCreatureSet;
class CGObjectInstance;
class CSlider;
struct UpgradeInfo;
template <typename T> struct CondSh;
class CInGameConsole;
class CInGameConsole;
union SDL_Event;
class CInfoWindow;
class IShowActivatable;
class ClickableL;
@ -52,7 +55,9 @@ class KeyInterested;
class MotionInterested;
class TimeInterested;
class IShowable;
struct CPathsInfo;
struct SDL_Surface;
union SDL_Event;
namespace boost
{

View File

@ -14,7 +14,8 @@
#include "../lib/StartInfo.h"
#include "../lib/CondSh.h"
struct SharedMemory;
VCMI_LIB_NAMESPACE_BEGIN
class CConnection;
class PlayerColor;
struct StartInfo;
@ -23,9 +24,15 @@ class CMapInfo;
struct ClientPlayer;
struct CPack;
struct CPackForLobby;
class CClient;
template<typename T> class CApplier;
VCMI_LIB_NAMESPACE_END
struct SharedMemory;
class CClient;
class CBaseForLobbyApply;
// TODO: Add mutex so we can't set CONNECTION_CANCELLED if client already connected, but thread not setup yet

View File

@ -19,25 +19,22 @@
#include "../lib/CondSh.h"
#include "../lib/CPathfinder.h"
VCMI_LIB_NAMESPACE_BEGIN
struct CPack;
struct CPackForServer;
class CCampaignState;
class CBattleCallback;
class IGameEventsReceiver;
class IBattleEventsReceiver;
class CBattleGameInterface;
class CGameState;
class CGameInterface;
class CCallback;
class BattleAction;
class CClient;
struct CPathsInfo;
class BinaryDeserializer;
class BinarySerializer;
namespace boost { class thread; }
template<typename T> class CApplier;
class CBaseForCLApply;
#if SCRIPTING_ENABLED
namespace scripting
@ -51,6 +48,15 @@ namespace events
class EventBus;
}
VCMI_LIB_NAMESPACE_END
class CBattleCallback;
class CCallback;
class CClient;
class CBaseForCLApply;
namespace boost { class thread; }
template<typename T>
class ThreadSafeVector
{

View File

@ -13,18 +13,23 @@
#include "../lib/GameConstants.h"
#include "gui/Geometries.h"
struct SDL_Surface;
VCMI_LIB_NAMESPACE_BEGIN
class CGHeroInstance;
class CGTownInstance;
class CHeroClass;
struct SDL_Color;
struct InfoAboutHero;
struct InfoAboutTown;
class CGObjectInstance;
class ObjectTemplate;
class CAnimation;
class EntityService;
VCMI_LIB_NAMESPACE_END
struct SDL_Surface;
struct SDL_Color;
class CAnimation;
enum EFonts
{
FONT_BIG, FONT_CALLI, FONT_CREDITS, FONT_HIGH_SCORE, FONT_MEDIUM, FONT_SMALL, FONT_TIMES, FONT_TINY, FONT_VERD

View File

@ -9,7 +9,12 @@
*/
#pragma once
struct SDL_RWops;
VCMI_LIB_NAMESPACE_BEGIN
class CInputStream;
VCMI_LIB_NAMESPACE_END
struct SDL_RWops;
SDL_RWops* MakeSDLRWops(std::unique_ptr<CInputStream> in);

View File

@ -7,3 +7,5 @@
// This header should be treated as a pre compiled header file(PCH) in the compiler building settings.
// Here you can add specific libraries and macros which are specific to this project.
VCMI_LIB_USING_NAMESPACE

View File

@ -12,8 +12,13 @@
#include "../../lib/battle/BattleHex.h"
#include "../widgets/Images.h"
class CBattleInterface;
VCMI_LIB_NAMESPACE_BEGIN
class CStack;
VCMI_LIB_NAMESPACE_END
class CBattleInterface;
class CCreatureAnimation;
struct CatapultProjectileInfo;
struct StackAttackedInfo;

View File

@ -19,14 +19,11 @@
#include "../../lib/spells/CSpellHandler.h" //CSpell::TAnimation
#include "../../lib/battle/CBattleInfoCallback.h"
class CLabel;
VCMI_LIB_NAMESPACE_BEGIN
class CCreatureSet;
class CGHeroInstance;
class CStack;
class CCallback;
class CButton;
class CToggleButton;
class CToggleGroup;
struct BattleResult;
struct BattleSpellCast;
struct CObstacleInstance;
@ -35,8 +32,21 @@ struct SetStackEffect;
class BattleAction;
class CGTownInstance;
struct CatapultAttack;
struct CatapultProjectileInfo;
struct BattleTriggerEffect;
struct BattleHex;
struct InfoAboutHero;
class CBattleGameInterface;
struct CustomEffectInfo;
class CSpell;
VCMI_LIB_NAMESPACE_END
class CLabel;
class CCallback;
class CButton;
class CToggleButton;
class CToggleGroup;
struct CatapultProjectileInfo;
class CBattleAnimation;
class CBattleHero;
class CBattleConsole;
@ -46,13 +56,8 @@ class CPlayerInterface;
class CCreatureAnimation;
struct ProjectileInfo;
class CClickableHex;
struct BattleHex;
struct InfoAboutHero;
class CBattleGameInterface;
struct CustomEffectInfo;
class CAnimation;
class IImage;
class CSpell;
/// Small struct which contains information about the id of the attacked stack, the damage dealt,...
struct StackAttackedInfo

View File

@ -13,8 +13,20 @@
#include "../../lib/battle/BattleHex.h"
#include "../windows/CWindowObject.h"
struct SDL_Surface;
VCMI_LIB_NAMESPACE_BEGIN
class CGHeroInstance;
struct BattleResult;
class CStack;
namespace battle
{
class Unit;
}
VCMI_LIB_NAMESPACE_END
struct SDL_Surface;
class CBattleInterface;
class CPicture;
class CFilledTexture;
@ -23,12 +35,6 @@ class CToggleButton;
class CToggleGroup;
class CLabel;
class CTextBox;
struct BattleResult;
class CStack;
namespace battle
{
class Unit;
}
class CAnimImage;
class CPlayerInterface;

View File

@ -21,8 +21,13 @@
#undef OUT
#endif
struct SDL_Surface;
VCMI_LIB_NAMESPACE_BEGIN
class JsonNode;
VCMI_LIB_NAMESPACE_END
struct SDL_Surface;
class CDefFile;
class ColorShifter;

View File

@ -13,6 +13,12 @@
#include "Geometries.h"
#include "SDL_Extensions.h"
VCMI_LIB_NAMESPACE_BEGIN
template <typename T> struct CondSh;
VCMI_LIB_NAMESPACE_END
class CFramerateManager;
class CGStatusBar;
class CIntObject;
@ -20,7 +26,6 @@ class IUpdateable;
class IShowActivatable;
class IShowable;
enum class EIntObjMouseBtnType;
template <typename T> struct CondSh;
// TODO: event handling need refactoring
enum EUserEvent

View File

@ -9,8 +9,12 @@
*/
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
class JsonNode;
VCMI_LIB_NAMESPACE_END
struct Point;
struct SDL_Surface;
struct SDL_Color;

View File

@ -10,8 +10,13 @@
#pragma once
#include "../windows/CWindowObject.h"
struct SDL_Surface;
VCMI_LIB_NAMESPACE_BEGIN
class CCampaignState;
VCMI_LIB_NAMESPACE_END
struct SDL_Surface;
class CButton;
class CTextBox;
class CToggleGroup;
@ -90,4 +95,4 @@ public:
std::shared_ptr<CButton> buttonDifficultyLeft;
std::shared_ptr<CButton> buttonDifficultyRight;
std::shared_ptr<CAnimImage> iconsMapSizes;
};
};

View File

@ -11,10 +11,15 @@
#include "CSelectionBase.h"
class CSelectionBase;
VCMI_LIB_NAMESPACE_BEGIN
struct StartInfo;
class CMapInfo;
VCMI_LIB_NAMESPACE_END
class CSelectionBase;
class CSavingScreen : public CSelectionBase
{
public:

View File

@ -11,6 +11,14 @@
#include "../mainmenu/CMainMenu.h"
VCMI_LIB_NAMESPACE_BEGIN
class CMapInfo;
struct StartInfo;
struct PlayerInfo;
VCMI_LIB_NAMESPACE_END
class CButton;
class CTextBox;
class CTextInput;
@ -21,9 +29,6 @@ class OptionsTab;
class SelectionTab;
class InfoCard;
class CChatBox;
class CMapInfo;
struct StartInfo;
struct PlayerInfo;
class CLabel;
class CFlagBox;
class CLabelGroup;

View File

@ -14,7 +14,12 @@
#include "../../lib/FunctionList.h"
#include "../../lib/GameConstants.h"
VCMI_LIB_NAMESPACE_BEGIN
class CMapGenOptions;
VCMI_LIB_NAMESPACE_END
class CToggleButton;
class CLabel;
class CLabelGroup;

View File

@ -11,11 +11,16 @@
#include "../windows/CWindowObject.h"
VCMI_LIB_NAMESPACE_BEGIN
class JsonNode;
VCMI_LIB_NAMESPACE_END
class CLabel;
class CPicture;
class CButton;
struct SDL_Surface;
class JsonNode;
class CCampaignScreen : public CWindowObject
{

View File

@ -12,7 +12,12 @@
#include "../windows/CWindowObject.h"
#include "../../lib/JsonNode.h"
VCMI_LIB_NAMESPACE_BEGIN
class CCampaignState;
VCMI_LIB_NAMESPACE_END
class CTextInput;
class CGStatusBar;
class CTextBox;

View File

@ -23,17 +23,22 @@
#undef OUT
#endif
VCMI_LIB_NAMESPACE_BEGIN
class CGObjectInstance;
class CGHeroInstance;
class CGBoat;
class CMap;
struct TerrainTile;
class PlayerColor;
VCMI_LIB_NAMESPACE_END
struct SDL_Surface;
struct SDL_Rect;
class CAnimation;
class IImage;
class CFadeAnimation;
class PlayerColor;
enum class EWorldViewIcon
{

View File

@ -13,21 +13,26 @@
#include "../../lib/FunctionList.h"
#include "Terrain.h"
VCMI_LIB_NAMESPACE_BEGIN
class CArmedInstance;
class CAnimation;
class CAnimImage;
class CShowableAnim;
class CFilledTexture;
class CGGarrison;
class CGObjectInstance;
class CGHeroInstance;
class CGTownInstance;
class CButton;
struct Component;
class CComponent;
struct InfoAboutArmy;
struct InfoAboutHero;
struct InfoAboutTown;
VCMI_LIB_NAMESPACE_END
class CAnimation;
class CAnimImage;
class CShowableAnim;
class CFilledTexture;
class CButton;
class CComponent;
class CHeroTooltip;
class CTownTooltip;
class CTextBox;

View File

@ -14,17 +14,21 @@
#include "../../lib/FunctionList.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace config
{
struct ButtonInfo;
}
VCMI_LIB_NAMESPACE_END
struct SDL_Surface;
struct Rect;
class CAnimImage;
class CLabel;
class CAnimation;
namespace config
{
struct ButtonInfo;
}
/// Typical Heroes 3 button which can be inactive or active and can
/// hold further information if you right-click it
class CButton : public CKeyShortcut

View File

@ -11,12 +11,16 @@
#include "MiscWidgets.h"
VCMI_LIB_NAMESPACE_BEGIN
struct ArtifactLocation;
VCMI_LIB_NAMESPACE_END
class CArtifactsOfHero;
class CAnimImage;
class CButton;
struct ArtifactLocation;
class CArtifactHolder
{
public:

View File

@ -11,7 +11,12 @@
#include "../gui/CIntObject.h"
VCMI_LIB_NAMESPACE_BEGIN
struct Component;
VCMI_LIB_NAMESPACE_END
class CAnimImage;
class CLabel;

View File

@ -11,13 +11,18 @@
#include "../windows/CWindowObject.h"
VCMI_LIB_NAMESPACE_BEGIN
class CArmedInstance;
class CCreatureSet;
class CStackInstance;
VCMI_LIB_NAMESPACE_END
class CGarrisonInt;
class CButton;
class CArmedInstance;
class CAnimImage;
class CCreatureSet;
class CGarrisonSlot;
class CStackInstance;
class CLabel;
/// A single garrison slot which holds one creature of a specific amount

View File

@ -11,13 +11,18 @@
#include "../gui/CIntObject.h"
class CLabel;
class CCreatureAnim;
class CComponent;
VCMI_LIB_NAMESPACE_BEGIN
class CGGarrison;
struct InfoAboutArmy;
class CArmedInstance;
class IBonusBearer;
VCMI_LIB_NAMESPACE_END
class CLabel;
class CCreatureAnim;
class CComponent;
class CAnimImage;
/// Shows a text by moving the mouse cursor over the object

View File

@ -17,14 +17,19 @@
#include "../../lib/spells/ViewSpellInt.h"
class CCallback;
VCMI_LIB_NAMESPACE_BEGIN
struct CGPath;
class CAdvMapInt;
class CGHeroInstance;
class CGTownInstance;
class CHeroWindow;
class CSpell;
class IShipyard;
VCMI_LIB_NAMESPACE_END
class CCallback;
class CAdvMapInt;
class CHeroWindow;
enum class EMapAnimRedrawStatus;
class CFadeAnimation;

View File

@ -12,23 +12,28 @@
#include "../widgets/CGarrisonInt.h"
#include "../widgets/Images.h"
class CButton;
VCMI_LIB_NAMESPACE_BEGIN
class CBuilding;
class CGTownInstance;
class CSpell;
struct CStructure;
class CGHeroInstance;
class CCreature;
VCMI_LIB_NAMESPACE_END
class CButton;
class CCastleBuildings;
class CCreaturePic;
class CGStatusBar;
class CGTownInstance;
class CLabel;
class CMinorResDataBar;
class CPicture;
class CResDataBar;
class CSpell;
class CTextBox;
class CTownList;
struct CStructure;
class CGHeroInstance;
class CGarrisonInt;
class CCreature;
class CComponent;
class CComponentBox;

View File

@ -13,11 +13,16 @@
#include "../widgets/MiscWidgets.h"
#include "CWindowObject.h"
class UnitView;
VCMI_LIB_NAMESPACE_BEGIN
class CCommanderInstance;
class CStackInstance;
class CStack;
struct UpgradeInfo;
VCMI_LIB_NAMESPACE_END
class UnitView;
class CTabbedInt;
class CButton;
class CMultiLineLabel;

View File

@ -13,9 +13,14 @@
#include "../widgets/CArtifactHolder.h"
#include "../widgets/CGarrisonInt.h"
VCMI_LIB_NAMESPACE_BEGIN
class CGHeroInstance;
VCMI_LIB_NAMESPACE_END
class CButton;
struct SDL_Surface;
class CGHeroInstance;
class CHeroWindow;
class LClickableAreaHero;
class LRClickableAreaWText;

View File

@ -29,7 +29,12 @@
#include "../../lib/NetPacksBase.h"
#include "../../lib/mapObjects/CQuest.h"
VCMI_LIB_NAMESPACE_BEGIN
struct QuestInfo;
VCMI_LIB_NAMESPACE_END
class CAdvmapInterface;
void CQuestLabel::clickLeft(tribool down, bool previousState)

View File

@ -15,11 +15,17 @@
#include "../widgets/Images.h"
#include "CWindowObject.h"
VCMI_LIB_NAMESPACE_BEGIN
class CCreature;
class CStackInstance;
class CGHeroInstance;
struct QuestInfo;
VCMI_LIB_NAMESPACE_END
class CButton;
class CToggleButton;
class CGHeroInstance;
class CComponentBox;
class LRClickableAreaWText;
class CButton;
@ -28,7 +34,6 @@ class CCreaturePic;
class LRClickableAreaWTextComp;
class CSlider;
class CLabel;
struct QuestInfo;
const int QUEST_COUNT = 6;
const int DESCRIPTION_HEIGHT_MAX = 355;

View File

@ -11,17 +11,22 @@
#include "CWindowObject.h"
VCMI_LIB_NAMESPACE_BEGIN
class CGHeroInstance;
class CSpell;
VCMI_LIB_NAMESPACE_END
struct SDL_Surface;
struct SDL_Rect;
class IImage;
class CAnimImage;
class CPicture;
class CLabel;
class CGHeroInstance;
class CGStatusBar;
class CPlayerInterface;
class CSpellWindow;
class CSpell;
/// The spell window
class CSpellWindow : public CWindowObject

View File

@ -13,7 +13,12 @@
#include "CWindowObject.h"
#include "../../lib/FunctionList.h"
VCMI_LIB_NAMESPACE_BEGIN
class IMarket;
VCMI_LIB_NAMESPACE_END
class CSlider;
class CTextBox;
class CGStatusBar;

View File

@ -17,9 +17,14 @@
#include "../widgets/CGarrisonInt.h"
#include "../widgets/Images.h"
VCMI_LIB_NAMESPACE_BEGIN
class CGDwelling;
class CreatureCostBox;
class IMarket;
VCMI_LIB_NAMESPACE_END
class CreatureCostBox;
class CCreaturePic;
class MoraleLuckBox;
class CHeroArea;

View File

@ -12,6 +12,12 @@
#include "CWindowObject.h"
#include "../../lib/FunctionList.h"
VCMI_LIB_NAMESPACE_BEGIN
class CGGarrison;
VCMI_LIB_NAMESPACE_END
struct SDL_Surface;
struct Rect;
class CAnimImage;
@ -19,7 +25,6 @@ class CLabel;
class CAnimation;
class CComponent;
class CSelectableComponent;
class CGGarrison;
class CTextBox;
class CButton;
class CSlider;

View File

@ -12,6 +12,8 @@
#include "Entity.h"
VCMI_LIB_NAMESPACE_BEGIN
class ArtifactID;
class CreatureID;
@ -25,3 +27,5 @@ public:
virtual uint32_t getPrice() const = 0;
virtual CreatureID getWarMachine() const = 0;
};
VCMI_LIB_NAMESPACE_END

View File

@ -12,6 +12,8 @@
#include "EntityService.h"
VCMI_LIB_NAMESPACE_BEGIN
class ArtifactID;
class Artifact;
@ -19,3 +21,5 @@ class DLL_LINKAGE ArtifactService : public EntityServiceT<ArtifactID, Artifact>
{
public:
};
VCMI_LIB_NAMESPACE_END

View File

@ -12,6 +12,8 @@
#include "Entity.h"
VCMI_LIB_NAMESPACE_BEGIN
class CreatureID;
class DLL_LINKAGE Creature : public EntityWithBonuses<CreatureID>
@ -43,3 +45,5 @@ public:
virtual bool isDoubleWide() const = 0;
};
VCMI_LIB_NAMESPACE_END

View File

@ -12,6 +12,8 @@
#include "EntityService.h"
VCMI_LIB_NAMESPACE_BEGIN
class CreatureID;
class Creature;
@ -19,3 +21,5 @@ class DLL_LINKAGE CreatureService : public EntityServiceT<CreatureID, Creature>
{
public:
};
VCMI_LIB_NAMESPACE_END

View File

@ -10,6 +10,8 @@
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
class IBonusBearer;
class DLL_LINKAGE Entity
@ -40,3 +42,5 @@ class DLL_LINKAGE EntityWithBonuses : public EntityT<IdType>
public:
virtual const IBonusBearer * accessBonuses() const = 0;
};
VCMI_LIB_NAMESPACE_END

View File

@ -10,6 +10,8 @@
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
class Entity;
class DLL_LINKAGE EntityService
@ -30,3 +32,5 @@ public:
virtual void forEach(const std::function<void(const EntityType * entity, bool & stop)> & cb) const = 0;
};
VCMI_LIB_NAMESPACE_END

View File

@ -10,6 +10,8 @@
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
class Services;
class IGameInfoCallback;
@ -23,8 +25,8 @@ namespace events
class DLL_LINKAGE Environment
{
public:
using BattleCb = ::IBattleInfoCallback;
using GameCb = ::IGameInfoCallback;
using BattleCb = IBattleInfoCallback;
using GameCb = IGameInfoCallback;
virtual ~Environment() = default;
@ -34,3 +36,5 @@ public:
virtual vstd::CLoggerBase * logger() const = 0;
virtual events::EventBus * eventBus() const = 0;
};
VCMI_LIB_NAMESPACE_END

View File

@ -12,6 +12,8 @@
#include "Entity.h"
VCMI_LIB_NAMESPACE_BEGIN
class FactionID;
class DLL_LINKAGE Faction : public EntityT<FactionID>
@ -19,3 +21,5 @@ class DLL_LINKAGE Faction : public EntityT<FactionID>
public:
virtual bool hasTown() const = 0;
};
VCMI_LIB_NAMESPACE_END

View File

@ -12,6 +12,8 @@
#include "EntityService.h"
VCMI_LIB_NAMESPACE_BEGIN
class FactionID;
class Faction;
@ -19,3 +21,5 @@ class DLL_LINKAGE FactionService : public EntityServiceT<FactionID, Faction>
{
public:
};
VCMI_LIB_NAMESPACE_END

View File

@ -12,6 +12,8 @@
#include "Entity.h"
VCMI_LIB_NAMESPACE_BEGIN
class HeroClassID;
class DLL_LINKAGE HeroClass : public EntityT<HeroClassID>
@ -20,3 +22,5 @@ public:
};
VCMI_LIB_NAMESPACE_END

View File

@ -12,6 +12,8 @@
#include "EntityService.h"
VCMI_LIB_NAMESPACE_BEGIN
class HeroClassID;
class HeroClass;
@ -19,3 +21,5 @@ class DLL_LINKAGE HeroClassService : public EntityServiceT<HeroClassID, HeroClas
{
public:
};
VCMI_LIB_NAMESPACE_END

View File

@ -12,6 +12,8 @@
#include "Entity.h"
VCMI_LIB_NAMESPACE_BEGIN
class HeroTypeID;
class DLL_LINKAGE HeroType : public EntityT<HeroTypeID>
@ -20,3 +22,5 @@ public:
};
VCMI_LIB_NAMESPACE_END

View File

@ -12,6 +12,8 @@
#include "EntityService.h"
VCMI_LIB_NAMESPACE_BEGIN
class HeroTypeID;
class HeroType;
@ -19,3 +21,5 @@ class DLL_LINKAGE HeroTypeService : public EntityServiceT<HeroTypeID, HeroType>
{
public:
};
VCMI_LIB_NAMESPACE_END

View File

@ -10,6 +10,8 @@
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
enum class Metatype : uint32_t
{
UNKNOWN = 0,
@ -28,3 +30,5 @@ enum class Metatype : uint32_t
SPELL
};
VCMI_LIB_NAMESPACE_END

View File

@ -10,6 +10,8 @@
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
class PlayerColor;
class TeamID;
class IBonusBearer;
@ -24,7 +26,4 @@ public:
virtual int getResourceAmount(int type) const = 0;
};
VCMI_LIB_NAMESPACE_END

View File

@ -10,6 +10,8 @@
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
namespace vstd
{
class RNG;
@ -44,3 +46,5 @@ public:
virtual void apply(BattleObstaclesChanged * pack) = 0;
virtual void apply(CatapultAttack * pack) = 0;
};
VCMI_LIB_NAMESPACE_END

View File

@ -12,6 +12,8 @@
#include "Metatype.h"
VCMI_LIB_NAMESPACE_BEGIN
class ArtifactService;
class CreatureService;
class FactionService;
@ -63,3 +65,5 @@ public:
virtual spells::effects::Registry * spellEffects() = 0;
//TODO: put map object types registry access here
};
VCMI_LIB_NAMESPACE_END

View File

@ -12,6 +12,8 @@
#include "Entity.h"
VCMI_LIB_NAMESPACE_BEGIN
class SecondarySkill;
class DLL_LINKAGE Skill : public EntityT<SecondarySkill>
@ -20,3 +22,5 @@ public:
};
VCMI_LIB_NAMESPACE_END

View File

@ -12,6 +12,8 @@
#include "EntityService.h"
VCMI_LIB_NAMESPACE_BEGIN
class SecondarySkill;
class Skill;
@ -19,3 +21,5 @@ class DLL_LINKAGE SkillService : public EntityServiceT<SecondarySkill, Skill>
{
public:
};
VCMI_LIB_NAMESPACE_END

View File

@ -13,6 +13,8 @@
#include "Event.h"
#include "SubscriptionRegistry.h"
VCMI_LIB_NAMESPACE_BEGIN
struct BattleStackAttacked;
namespace battle
@ -43,3 +45,5 @@ public:
};
}
VCMI_LIB_NAMESPACE_END

View File

@ -10,6 +10,8 @@
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
namespace events
{
@ -27,3 +29,5 @@ public:
}
VCMI_LIB_NAMESPACE_END

View File

@ -12,6 +12,8 @@
#include "SubscriptionRegistry.h"
VCMI_LIB_NAMESPACE_BEGIN
class Environment;
namespace events
@ -42,3 +44,5 @@ public:
}
};
}
VCMI_LIB_NAMESPACE_END

View File

@ -13,6 +13,8 @@
#include "Event.h"
#include "SubscriptionRegistry.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace events
{
@ -33,3 +35,5 @@ public:
};
}
VCMI_LIB_NAMESPACE_END

View File

@ -13,6 +13,8 @@
#include "Event.h"
#include "SubscriptionRegistry.h"
VCMI_LIB_NAMESPACE_BEGIN
class PlayerColor;
class ObjectInstanceID;
@ -38,3 +40,5 @@ public:
};
}
VCMI_LIB_NAMESPACE_END

View File

@ -13,6 +13,8 @@
#include "Event.h"
#include "SubscriptionRegistry.h"
VCMI_LIB_NAMESPACE_BEGIN
class PlayerColor;
class ObjectInstanceID;
@ -41,3 +43,5 @@ public:
};
}
VCMI_LIB_NAMESPACE_END

View File

@ -13,6 +13,8 @@
#include "Event.h"
#include "SubscriptionRegistry.h"
VCMI_LIB_NAMESPACE_BEGIN
class PlayerColor;
namespace events
@ -39,3 +41,5 @@ public:
};
}
VCMI_LIB_NAMESPACE_END

View File

@ -10,6 +10,8 @@
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
class Environment;
namespace events
@ -164,3 +166,5 @@ private:
}
};
}
VCMI_LIB_NAMESPACE_END

View File

@ -13,6 +13,8 @@
#include "Event.h"
#include "SubscriptionRegistry.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace events
{
@ -31,3 +33,5 @@ public:
};
}
VCMI_LIB_NAMESPACE_END

View File

@ -13,6 +13,8 @@
#if SCRIPTING_ENABLED
#include <vcmi/Environment.h>
VCMI_LIB_NAMESPACE_BEGIN
class Services;
class JsonNode;
class ServerCallback;
@ -20,8 +22,8 @@ class ServerCallback;
namespace scripting
{
using BattleCb = ::Environment::BattleCb;
using GameCb = ::Environment::GameCb;
using BattleCb = Environment::BattleCb;
using GameCb = Environment::GameCb;
class DLL_LINKAGE Context
{
@ -79,4 +81,6 @@ public:
}
VCMI_LIB_NAMESPACE_END
#endif

View File

@ -10,6 +10,8 @@
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
class PlayerColor;
struct MetaString;
class ServerCallback;
@ -66,3 +68,5 @@ public:
};
}
VCMI_LIB_NAMESPACE_END

View File

@ -10,6 +10,8 @@
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
struct MetaString;
namespace battle
@ -24,7 +26,7 @@ class Caster;
class Spell;
class Mechanics;
class BattleCast;
using Destination = ::battle::Destination;
using Destination = battle::Destination;
using Target = std::vector<Destination>;
@ -67,3 +69,5 @@ public:
};
}
VCMI_LIB_NAMESPACE_END

View File

@ -12,6 +12,8 @@
#include "../EntityService.h"
VCMI_LIB_NAMESPACE_BEGIN
class SpellID;
namespace spells
@ -24,3 +26,5 @@ public:
};
}
VCMI_LIB_NAMESPACE_END

View File

@ -12,6 +12,8 @@
#include "../Entity.h"
VCMI_LIB_NAMESPACE_BEGIN
class SpellID;
namespace spells
@ -54,3 +56,5 @@ public:
};
}
VCMI_LIB_NAMESPACE_END

View File

@ -10,6 +10,8 @@
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
namespace ELogLevel
{
enum ELogLevel
@ -191,3 +193,5 @@ extern DLL_LINKAGE vstd::CLoggerBase * logNetwork;
extern DLL_LINKAGE vstd::CLoggerBase * logAi;
extern DLL_LINKAGE vstd::CLoggerBase * logAnim;
extern DLL_LINKAGE vstd::CLoggerBase * logMod;
VCMI_LIB_NAMESPACE_END

View File

@ -10,6 +10,8 @@
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
namespace vstd
{
template<typename K, typename V>
@ -24,5 +26,4 @@ namespace vstd
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -10,6 +10,8 @@
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
namespace vstd
{
@ -56,3 +58,5 @@ namespace RandomGeneratorUtil
}
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -1,5 +1,7 @@
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
namespace vstd
{
@ -7,3 +9,5 @@ namespace vstd
DLL_LINKAGE std::pair<std::string, std::string> splitStringToPair(std::string input, char separator);
}
VCMI_LIB_NAMESPACE_END

View File

@ -11,8 +11,12 @@
#include <QDialog>
#include <QNetworkAccessManager>
VCMI_LIB_NAMESPACE_BEGIN
class JsonNode;
VCMI_LIB_NAMESPACE_END
namespace Ui {
class UpdateDialog;
}

View File

@ -12,6 +12,8 @@
#include <vcmi/Entity.h>
#include "BattleFieldHandler.h"
VCMI_LIB_NAMESPACE_BEGIN
BattleFieldInfo * BattleFieldHandler::loadFromJson(const std::string & scope, const JsonNode & json, const std::string & identifier, size_t index)
{
BattleFieldInfo * info = new BattleFieldInfo(BattleField(index), identifier);
@ -105,4 +107,6 @@ void BattleFieldInfo::registerIcons(const IconRegistar & cb) const
BattleField BattleFieldInfo::getId() const
{
return battlefield;
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -17,6 +17,8 @@
#include "Terrain.h"
#include "battle/BattleHex.h"
VCMI_LIB_NAMESPACE_BEGIN
class BattleFieldInfo : public EntityT<BattleField>
{
public:
@ -84,3 +86,5 @@ public:
h & objects;
}
};
VCMI_LIB_NAMESPACE_END

View File

@ -48,6 +48,8 @@
ART_POS(SHOULDERS) \
ART_POS(HEAD)
VCMI_LIB_NAMESPACE_BEGIN
int32_t CArtifact::getIndex() const
{
return id.toEnum();
@ -1434,3 +1436,5 @@ void CArtifactSet::serializeJsonSlot(JsonSerializeFormat & handler, const Artifa
}
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -16,6 +16,8 @@
#include "GameConstants.h"
#include "IHandlerBase.h"
VCMI_LIB_NAMESPACE_BEGIN
class CArtHandler;
class CArtifact;
class CGHeroInstance;
@ -358,3 +360,5 @@ private:
void serializeJsonSlot(JsonSerializeFormat & handler, const ArtifactPosition & slot, CMap * map);//normal slots
};
VCMI_LIB_NAMESPACE_END

View File

@ -20,7 +20,9 @@
#include "CCreatureHandler.h"
#include "spells/CSpellHandler.h"
template class std::vector<CBonusType>;
template class std::vector<VCMI_LIB_WRAP_NAMESPACE(CBonusType)>;
VCMI_LIB_NAMESPACE_BEGIN
///MacroString
@ -326,3 +328,5 @@ void CBonusTypeHandler::loadItem(const JsonNode & source, CBonusType & dest)
}
dest.buildMacros();
}
VCMI_LIB_NAMESPACE_END

Some files were not shown because too many files have changed in this diff Show More