1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

vcmi: move bonuses to its own folder

This commit is contained in:
Konstantin 2023-04-27 23:41:41 +03:00
parent 03b8ce2d4c
commit 6fa1b2b19f
38 changed files with 43 additions and 45 deletions

View File

@ -36,9 +36,9 @@ void actualizeEffect(TBonusListPtr target, const Bonus & ef)
}
}
StackWithBonuses::StackWithBonuses(const HypotheticBattle * Owner, const CStack * Stack)
StackWithBonuses::StackWithBonuses(const HypotheticBattle * Owner, const battle::CUnitState * Stack)
: battle::CUnitState(),
origBearer(Stack),
origBearer(Stack->getBonusBearer()),
owner(Owner),
type(Stack->unitType()),
baseAmount(Stack->unitBaseAmount()),

View File

@ -14,16 +14,10 @@
#include <vcmi/Environment.h>
#include <vcmi/ServerCallback.h>
#include "../../lib/HeroBonus.h"
#include "../../lib/bonuses/HeroBonus.h"
#include "../../lib/battle/BattleProxy.h"
#include "../../lib/battle/CUnitState.h"
VCMI_LIB_NAMESPACE_BEGIN
class CStack;
VCMI_LIB_NAMESPACE_END
class HypotheticBattle;
///Fake random generator, used by AI to evaluate random server behavior
@ -54,7 +48,7 @@ public:
std::vector<Bonus> bonusesToUpdate;
std::set<std::shared_ptr<Bonus>> bonusesToRemove;
StackWithBonuses(const HypotheticBattle * Owner, const CStack * Stack);
StackWithBonuses(const HypotheticBattle * Owner, const battle::CUnitState * Stack);
StackWithBonuses(const HypotheticBattle * Owner, const battle::UnitInfo & info);

View File

@ -9,7 +9,7 @@
*/
#pragma once
#include "../../lib/HeroBonus.h"
#include "../../lib/bonuses/HeroBonus.h"
#include "../widgets/MiscWidgets.h"
#include "CWindowObject.h"

View File

@ -11,7 +11,7 @@
#include <vcmi/FactionMember.h>
#include "../../lib/HeroBonus.h"
#include "../../lib/bonuses/HeroBonus.h"
#include "../widgets/CWindowWithArtifacts.h"
#include "../widgets/CGarrisonInt.h"

View File

@ -61,7 +61,7 @@
#include "../lib/CStopWatch.h"
#include "../lib/CTownHandler.h"
#include "../lib/GameConstants.h"
#include "../lib/HeroBonus.h"
#include "../lib/bonuses/HeroBonus.h"
#include "../lib/mapping/CMap.h"
#include "../lib/NetPacksBase.h"
#include "../lib/StartInfo.h"

View File

@ -27,6 +27,8 @@ macro(add_main_lib TARGET_NAME LIBRARY_TYPE)
${MAIN_LIB_DIR}/battle/SiegeInfo.cpp
${MAIN_LIB_DIR}/battle/Unit.cpp
${MAIN_LIB_DIR}/bonuses/HeroBonus.cpp
${MAIN_LIB_DIR}/events/ApplyDamage.cpp
${MAIN_LIB_DIR}/events/GameResumed.cpp
${MAIN_LIB_DIR}/events/ObjectVisitEnded.cpp
@ -198,7 +200,6 @@ macro(add_main_lib TARGET_NAME LIBRARY_TYPE)
${MAIN_LIB_DIR}/CTownHandler.cpp
${MAIN_LIB_DIR}/GameConstants.cpp
${MAIN_LIB_DIR}/GameSettings.cpp
${MAIN_LIB_DIR}/HeroBonus.cpp
${MAIN_LIB_DIR}/IGameCallback.cpp
${MAIN_LIB_DIR}/IHandlerBase.cpp
${MAIN_LIB_DIR}/JsonDetail.cpp
@ -300,6 +301,8 @@ macro(add_main_lib TARGET_NAME LIBRARY_TYPE)
${MAIN_LIB_DIR}/battle/SiegeInfo.h
${MAIN_LIB_DIR}/battle/Unit.h
${MAIN_LIB_DIR}/bonuses/HeroBonus.h
${MAIN_LIB_DIR}/events/ApplyDamage.h
${MAIN_LIB_DIR}/events/GameResumed.h
${MAIN_LIB_DIR}/events/ObjectVisitEnded.h
@ -478,7 +481,6 @@ macro(add_main_lib TARGET_NAME LIBRARY_TYPE)
${MAIN_LIB_DIR}/FunctionList.h
${MAIN_LIB_DIR}/GameConstants.h
${MAIN_LIB_DIR}/GameSettings.h
${MAIN_LIB_DIR}/HeroBonus.h
${MAIN_LIB_DIR}/IBonusTypeHandler.h
${MAIN_LIB_DIR}/IGameCallback.h
${MAIN_LIB_DIR}/IGameEventsReceiver.h

View File

@ -12,7 +12,7 @@
#include "VCMI_Lib.h"
#include "GameConstants.h"
#include "HeroBonus.h"
#include "bonuses/HeroBonus.h"
#include <vcmi/Creature.h>
#include <vcmi/Faction.h>

View File

@ -11,7 +11,7 @@
#include <vcmi/EntityService.h>
#include <vcmi/Entity.h>
#include "HeroBonus.h"
#include "bonuses/HeroBonus.h"
#include "GameConstants.h"
#include "IHandlerBase.h"
#include "battle/BattleHex.h"

View File

@ -12,7 +12,7 @@
#include <vcmi/Artifact.h>
#include <vcmi/ArtifactService.h>
#include "HeroBonus.h"
#include "bonuses/HeroBonus.h"
#include "GameConstants.h"
#include "IHandlerBase.h"

View File

@ -12,7 +12,7 @@
#include "IBonusTypeHandler.h"
#include "IHandlerBase.h"
#include "HeroBonus.h"
#include "bonuses/HeroBonus.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -9,7 +9,7 @@
*/
#pragma once
#include "HeroBonus.h"
#include "bonuses/HeroBonus.h"
#include "ConstTransitivePtr.h"
#include "ResourceSet.h"
#include "GameConstants.h"

View File

@ -9,7 +9,7 @@
*/
#pragma once
#include "HeroBonus.h"
#include "bonuses/HeroBonus.h"
#include "GameConstants.h"
#include "CArtHandler.h"
#include "CCreatureHandler.h"

View File

@ -12,7 +12,7 @@
#include "CCreatureHandler.h"
#include "VCMI_Lib.h"
#include "HeroBonus.h"
#include "bonuses/HeroBonus.h"
#include "CCreatureSet.h"
#include "ConstTransitivePtr.h"
#include "IGameCallback.h"

View File

@ -16,7 +16,7 @@
#include "../lib/ConstTransitivePtr.h"
#include "GameConstants.h"
#include "HeroBonus.h"
#include "bonuses/HeroBonus.h"
#include "IHandlerBase.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -11,7 +11,7 @@
#include "VCMI_Lib.h"
#include "IGameCallback.h"
#include "HeroBonus.h"
#include "bonuses/HeroBonus.h"
#include "int3.h"
#include <boost/heap/fibonacci_heap.hpp>

View File

@ -12,7 +12,7 @@
#include <vcmi/Player.h>
#include <vcmi/Team.h>
#include "HeroBonus.h"
#include "bonuses/HeroBonus.h"
#include "ResourceSet.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -12,7 +12,7 @@
#include <vcmi/Skill.h>
#include <vcmi/SkillService.h>
#include "../lib/HeroBonus.h"
#include "../lib/bonuses/HeroBonus.h"
#include "GameConstants.h"
#include "IHandlerBase.h"

View File

@ -10,7 +10,7 @@
#pragma once
#include "JsonNode.h"
#include "HeroBonus.h"
#include "bonuses/HeroBonus.h"
#include "CCreatureHandler.h" //todo: remove
#include "battle/BattleHex.h"
#include "mapObjects/CGHeroInstance.h" // for commander serialization

View File

@ -23,7 +23,7 @@
#include "filesystem/Filesystem.h"
#include "mapObjects/CObjectClassesHandler.h"
#include "mapObjects/CObjectHandler.h"
#include "HeroBonus.h"
#include "bonuses/HeroBonus.h"
#include "ResourceSet.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -19,7 +19,7 @@
#include "IHandlerBase.h"
#include "LogicalExpression.h"
#include "battle/BattleHex.h"
#include "HeroBonus.h"
#include "bonuses/HeroBonus.h"
#include "Point.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -13,7 +13,7 @@
#include "ScopeGuard.h"
#include "HeroBonus.h"
#include "bonuses/HeroBonus.h"
#include "filesystem/Filesystem.h"
#include "VCMI_Lib.h" //for identifier resolution
#include "CModHandler.h"

View File

@ -9,7 +9,7 @@
*/
#pragma once
#include "../int3.h"
#include "../HeroBonus.h"
#include "../bonuses/HeroBonus.h"
#include "CBattleInfoCallback.h"
#include "IBattleState.h"
#include "SiegeInfo.h"

View File

@ -13,7 +13,7 @@
#include "CBattleInfoCallback.h"
#include "Unit.h"
#include "../HeroBonus.h"
#include "../bonuses/HeroBonus.h"
#include "../mapObjects/CGTownInstance.h"
#include "../spells/CSpellHandler.h"
#include "../GameSettings.h"

View File

@ -13,7 +13,7 @@
#include <vcmi/Creature.h>
#include <vcmi/spells/Caster.h>
#include "../HeroBonus.h"
#include "../bonuses/HeroBonus.h"
#include "IUnitInfo.h"
#include "BattleHex.h"

View File

@ -12,6 +12,7 @@
#include "CGTownInstance.h"
#include "CObjectClassesHandler.h"
#include "../spells/CSpellHandler.h"
#include "../bonuses/HeroBonus.h"
#include "../battle/IBattleInfoCallback.h"
#include "../NetPacks.h"
#include "../CConfigHandler.h"
@ -23,7 +24,6 @@
#include "../CPlayerState.h"
#include "../TerrainHandler.h"
#include "../serializer/JsonSerializeFormat.h"
#include "../HeroBonus.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -12,10 +12,11 @@
#include "ObjectTemplate.h"
#include "../int3.h"
#include "../HeroBonus.h"
#include "../NetPacksBase.h"
#include "../ResourceSet.h"
#include "../bonuses/HeroBonus.h"
VCMI_LIB_NAMESPACE_BEGIN
class CGHeroInstance;

View File

@ -11,7 +11,8 @@
#include "JsonUpdater.h"
#include "../JsonNode.h"
#include "../HeroBonus.h"
#include "../bonuses/HeroBonus.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -14,8 +14,8 @@
#include <vcmi/spells/Spell.h>
#include "../NetPacksBase.h"
#include "../HeroBonus.h"
#include "../battle/Unit.h"
#include "../bonuses/HeroBonus.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -19,7 +19,7 @@
#include "../int3.h"
#include "../GameConstants.h"
#include "../battle/BattleHex.h"
#include "../HeroBonus.h"
#include "../bonuses/HeroBonus.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -14,7 +14,7 @@
#include "../CRandomGenerator.h"
#include "../VCMI_Lib.h"
#include "../HeroBonus.h"
#include "../bonuses/HeroBonus.h"
#include "../battle/CBattleInfoCallback.h"
#include "../battle/IBattleState.h"
#include "../battle/Unit.h"

View File

@ -16,7 +16,7 @@
#include "../battle/Destination.h"
#include "../int3.h"
#include "../GameConstants.h"
#include "../HeroBonus.h"
#include "../bonuses/HeroBonus.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -15,7 +15,7 @@
#include "../LuaStack.h"
#include "../LuaCallWrapper.h"
#include "../../../lib/HeroBonus.h"
#include "../../../lib/bonuses/HeroBonus.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -11,7 +11,7 @@
#include "BonusSystem.h"
#include "../../../lib/HeroBonus.h"
#include "../../../lib/bonuses/HeroBonus.h"
#include "Registry.h"

View File

@ -15,7 +15,7 @@
#include "../LuaStack.h"
#include "../LuaCallWrapper.h"
#include "../../../lib/HeroBonus.h"
#include "../../../lib/bonuses/HeroBonus.h"
VCMI_LIB_NAMESPACE_BEGIN

View File

@ -10,7 +10,7 @@
#pragma once
#include "../../lib/HeroBonus.h"
#include "../../lib/bonuses/HeroBonus.h"
class BonusBearerMock : public IBonusBearer

View File

@ -15,10 +15,10 @@
#include <vcmi/events/EventBus.h>
#include "../../lib/JsonNode.h"
#include "../../lib/HeroBonus.h"
#include "../../lib/ScriptHandler.h"
#include "../../lib/NetPacksBase.h"
#include "../../lib/battle/CBattleInfoCallback.h"
#include "../../lib/bonuses/HeroBonus.h"
#include "../mock/mock_ServerCallback.h"
#include "../mock/mock_IBattleInfoCallback.h"