瀏覽代碼

Reogranize callback-related classes on 1 file = 1 class basis

Ivan Savenko 5 月之前
父節點
當前提交
35644da2b7
共有 100 個文件被更改,包括 88 次插入345 次删除
  1. 0 1
      AI/BattleAI/AttackPossibility.h
  2. 3 0
      AI/BattleAI/BattleAI.cpp
  3. 1 1
      AI/BattleAI/BattleAI.h
  4. 2 0
      AI/BattleAI/BattleEvaluator.cpp
  5. 2 1
      AI/BattleAI/BattleEvaluator.h
  6. 0 1
      AI/BattleAI/BattleExchangeVariant.h
  7. 0 1
      AI/BattleAI/main.cpp
  8. 2 0
      AI/EmptyAI/CEmptyAI.cpp
  9. 1 2
      AI/EmptyAI/CEmptyAI.h
  10. 1 0
      AI/Nullkiller/AIGateway.cpp
  11. 1 2
      AI/Nullkiller/AIGateway.h
  12. 1 1
      AI/Nullkiller/AIUtility.h
  13. 0 1
      AI/Nullkiller/Analyzers/ArmyManager.cpp
  14. 0 1
      AI/Nullkiller/Engine/AIMemory.cpp
  15. 0 1
      AI/Nullkiller/Engine/PriorityEvaluator.cpp
  16. 0 1
      AI/Nullkiller/Goals/CompleteQuest.h
  17. 1 1
      AI/Nullkiller/Pathfinding/AINodeStorage.cpp
  18. 0 1
      AI/Nullkiller/Pathfinding/AIPathfinder.cpp
  19. 0 1
      AI/Nullkiller/Pathfinding/Actors.cpp
  20. 0 1
      AI/Nullkiller/Pathfinding/GraphPaths.cpp
  21. 0 1
      AI/Nullkiller/Pathfinding/ObjectGraph.cpp
  22. 0 1
      AI/Nullkiller/Pathfinding/ObjectGraphCalculator.cpp
  23. 0 1
      AI/Nullkiller/Pathfinding/Rules/AILayerTransitionRule.h
  24. 0 1
      AI/Nullkiller/Pathfinding/Rules/AIMovementAfterDestinationRule.h
  25. 0 1
      AI/Nullkiller/Pathfinding/Rules/AIMovementToDestinationRule.h
  26. 0 1
      AI/Nullkiller/Pathfinding/Rules/AIPreviousNodeRule.h
  27. 0 1
      AI/Nullkiller/StdInc.h
  28. 2 2
      AI/StupidAI/StupidAI.cpp
  29. 1 1
      AI/StupidAI/StupidAI.h
  30. 0 1
      AI/StupidAI/main.cpp
  31. 1 1
      AI/VCAI/AIUtility.h
  32. 0 1
      AI/VCAI/ArmyManager.cpp
  33. 0 1
      AI/VCAI/BuildingManager.cpp
  34. 1 1
      AI/VCAI/Pathfinding/AINodeStorage.cpp
  35. 0 1
      AI/VCAI/Pathfinding/AIPathfinder.cpp
  36. 0 1
      AI/VCAI/Pathfinding/PathfindingManager.cpp
  37. 0 1
      AI/VCAI/Pathfinding/Rules/AILayerTransitionRule.h
  38. 0 1
      AI/VCAI/Pathfinding/Rules/AIMovementAfterDestinationRule.h
  39. 0 1
      AI/VCAI/Pathfinding/Rules/AIMovementToDestinationRule.h
  40. 0 1
      AI/VCAI/Pathfinding/Rules/AIPreviousNodeRule.h
  41. 0 1
      AI/VCAI/ResourceManager.cpp
  42. 1 0
      AI/VCAI/VCAI.cpp
  43. 1 3
      AI/VCAI/VCAI.h
  44. 0 219
      CCallback.h
  45. 1 1
      client/ArtifactsUIController.cpp
  46. 0 1
      client/CMakeLists.txt
  47. 5 2
      client/CPlayerInterface.cpp
  48. 1 1
      client/CPlayerInterface.h
  49. 6 2
      client/Client.cpp
  50. 3 2
      client/Client.h
  51. 3 1
      client/ClientCommandManager.cpp
  52. 1 2
      client/GameChatHandler.cpp
  53. 1 2
      client/HeroMovementController.cpp
  54. 1 1
      client/NetPacksClient.cpp
  55. 1 1
      client/PlayerLocalState.cpp
  56. 1 1
      client/adventureMap/AdventureMapInterface.cpp
  57. 1 1
      client/adventureMap/AdventureMapShortcuts.cpp
  58. 1 1
      client/adventureMap/AdventureOptions.cpp
  59. 0 1
      client/adventureMap/CInGameConsole.cpp
  60. 1 1
      client/adventureMap/CInfoBar.cpp
  61. 1 2
      client/adventureMap/CList.cpp
  62. 1 1
      client/adventureMap/CMinimap.cpp
  63. 1 1
      client/adventureMap/CResDataBar.cpp
  64. 1 1
      client/adventureMap/MapAudioPlayer.cpp
  65. 2 1
      client/adventureMap/TurnTimerWidget.cpp
  66. 2 1
      client/battle/BattleActionsController.cpp
  67. 1 1
      client/battle/BattleAnimationClasses.cpp
  68. 1 3
      client/battle/BattleEffectsController.cpp
  69. 1 1
      client/battle/BattleFieldController.cpp
  70. 2 1
      client/battle/BattleInterface.cpp
  71. 2 1
      client/battle/BattleInterfaceClasses.cpp
  72. 1 1
      client/battle/BattleObstacleController.cpp
  73. 1 1
      client/battle/BattleSiegeController.cpp
  74. 1 2
      client/battle/BattleStacksController.cpp
  75. 3 2
      client/battle/BattleWindow.cpp
  76. 1 1
      client/lobby/CCampaignInfoScreen.cpp
  77. 0 2
      client/lobby/CLobbyScreen.cpp
  78. 1 1
      client/lobby/CSavingScreen.cpp
  79. 1 2
      client/lobby/CScenarioInfoScreen.cpp
  80. 0 2
      client/lobby/CSelectionBase.cpp
  81. 0 2
      client/lobby/SelectionTab.cpp
  82. 0 2
      client/mainmenu/CMainMenu.cpp
  83. 0 2
      client/mapView/MapRenderer.cpp
  84. 1 1
      client/mapView/MapRendererContext.cpp
  85. 1 1
      client/mapView/MapRendererContextState.cpp
  86. 1 2
      client/mapView/MapView.cpp
  87. 1 1
      client/mapView/MapViewController.cpp
  88. 2 1
      client/mapView/mapHandler.cpp
  89. 0 2
      client/widgets/CArtifactsOfHeroAltar.cpp
  90. 1 2
      client/widgets/CArtifactsOfHeroBackpack.cpp
  91. 1 1
      client/widgets/CArtifactsOfHeroBase.cpp
  92. 0 1
      client/widgets/CArtifactsOfHeroKingdom.cpp
  93. 1 2
      client/widgets/CArtifactsOfHeroMain.cpp
  94. 1 2
      client/widgets/CComponentHolder.cpp
  95. 1 2
      client/widgets/CExchangeController.cpp
  96. 1 2
      client/widgets/CGarrisonInt.cpp
  97. 0 2
      client/widgets/Images.cpp
  98. 1 2
      client/widgets/MiscWidgets.cpp
  99. 1 2
      client/widgets/markets/CAltarArtifacts.cpp
  100. 1 2
      client/widgets/markets/CAltarCreatures.cpp

+ 0 - 1
AI/BattleAI/AttackPossibility.h

@@ -9,7 +9,6 @@
  */
 #pragma once
 #include "../../lib/battle/CUnitState.h"
-#include "../../CCallback.h"
 #include "StackWithBonuses.h"
 
 #define BATTLE_TRACE_LEVEL 0

+ 3 - 0
AI/BattleAI/BattleAI.cpp

@@ -17,6 +17,9 @@
 #include "tbb/parallel_for.h"
 #include "../../lib/CStopWatch.h"
 #include "../../lib/CThreadHelper.h"
+#include "../../lib/battle/CPlayerBattleCallback.h"
+#include "../../lib/callback/CBattleCallback.h"
+#include "../../lib/callback/IGameInfoCallback.h"
 #include "../../lib/mapObjects/CGTownInstance.h"
 #include "../../lib/spells/CSpellHandler.h"
 #include "../../lib/spells/ISpellMechanics.h"

+ 1 - 1
AI/BattleAI/BattleAI.h

@@ -8,8 +8,8 @@
  *
  */
 #pragma once
-#include "../../lib/AI_Base.h"
 #include "../../lib/battle/ReachabilityInfo.h"
+#include "../../lib/callback/CGameInterface.h"
 #include "PossibleSpellcast.h"
 #include "PotentialTargets.h"
 

+ 2 - 0
AI/BattleAI/BattleEvaluator.cpp

@@ -16,6 +16,8 @@
 #include "tbb/parallel_for.h"
 #include "../../lib/CStopWatch.h"
 #include "../../lib/CThreadHelper.h"
+#include "../../lib/battle/CPlayerBattleCallback.h"
+#include "../../lib/callback/CBattleCallback.h"
 #include "../../lib/mapObjects/CGTownInstance.h"
 #include "../../lib/entities/building/TownFortifications.h"
 #include "../../lib/spells/CSpellHandler.h"

+ 2 - 1
AI/BattleAI/BattleEvaluator.h

@@ -8,7 +8,6 @@
  *
  */
 #pragma once
-#include "../../lib/AI_Base.h"
 #include "../../lib/battle/ReachabilityInfo.h"
 #include "PossibleSpellcast.h"
 #include "PotentialTargets.h"
@@ -17,6 +16,8 @@
 VCMI_LIB_NAMESPACE_BEGIN
 
 class CSpell;
+class CBattleCallback;
+class BattleAction;
 
 VCMI_LIB_NAMESPACE_END
 

+ 0 - 1
AI/BattleAI/BattleExchangeVariant.h

@@ -9,7 +9,6 @@
  */
 #pragma once
 
-#include "../../lib/AI_Base.h"
 #include "../../lib/battle/ReachabilityInfo.h"
 #include "PotentialTargets.h"
 #include "StackWithBonuses.h"

+ 0 - 1
AI/BattleAI/main.cpp

@@ -8,7 +8,6 @@
  *
  */
 #include "StdInc.h"
-#include "../../lib/AI_Base.h"
 #include "BattleAI.h"
 
 #ifdef __GNUC__

+ 2 - 0
AI/EmptyAI/CEmptyAI.cpp

@@ -13,6 +13,8 @@
 #include "../../lib/CRandomGenerator.h"
 #include "../../lib/CStack.h"
 #include "../../lib/battle/BattleAction.h"
+#include "../../lib/battle/CPlayerBattleCallback.h"
+#include "../../lib/callback/CCallback.h"
 
 void CEmptyAI::initGameInterface(std::shared_ptr<Environment> ENV, std::shared_ptr<CCallback> CB)
 {

+ 1 - 2
AI/EmptyAI/CEmptyAI.h

@@ -9,8 +9,7 @@
  */
 #pragma once
 
-#include "../../lib/AI_Base.h"
-#include "../../CCallback.h"
+#include "../../lib/callback/CGlobalAI.h"
 
 struct HeroMoveDetails;
 

+ 1 - 0
AI/Nullkiller/AIGateway.cpp

@@ -12,6 +12,7 @@
 #include "../../lib/AsyncRunner.h"
 #include "../../lib/UnlockGuard.h"
 #include "../../lib/StartInfo.h"
+#include "../../lib/battle/CPlayerBattleCallback.h"
 #include "../../lib/entities/artifact/ArtifactUtils.h"
 #include "../../lib/entities/artifact/CArtifact.h"
 #include "../../lib/entities/building/CBuilding.h"

+ 1 - 2
AI/Nullkiller/AIGateway.h

@@ -11,12 +11,11 @@
 
 #include "AIUtility.h"
 #include "Goals/AbstractGoal.h"
-#include "../../lib/AI_Base.h"
-#include "../../CCallback.h"
 #include "../../lib/CThreadHelper.h"
 #include "../../lib/GameConstants.h"
 #include "../../lib/GameLibrary.h"
 #include "../../lib/CCreatureHandler.h"
+#include "../../lib/callback/CAdventureAI.h"
 #include "../../lib/mapObjects/MiscObjects.h"
 #include "../../lib/spells/CSpellHandler.h"
 #include "Pathfinding/AIPathfinder.h"

+ 1 - 1
AI/Nullkiller/AIUtility.h

@@ -44,7 +44,7 @@
 #include "../../lib/spells/CSpellHandler.h"
 #include "../../lib/CStopWatch.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"
-#include "../../CCallback.h"
+#include "../../lib/callback/CCallback.h"
 
 #include <chrono>
 

+ 0 - 1
AI/Nullkiller/Analyzers/ArmyManager.cpp

@@ -11,7 +11,6 @@
 #include "StdInc.h"
 #include "ArmyManager.h"
 #include "../Engine/Nullkiller.h"
-#include "../../../CCallback.h"
 #include "../../../lib/mapObjects/MapObjects.h"
 #include "../../../lib/mapping/CMapDefines.h"
 #include "../../../lib/IGameSettings.h"

+ 0 - 1
AI/Nullkiller/Engine/AIMemory.cpp

@@ -9,7 +9,6 @@
 */
 #include "../StdInc.h"
 #include "AIMemory.h"
-#include "../../../CCallback.h"
 
 namespace NKAI
 {

+ 0 - 1
AI/Nullkiller/Engine/PriorityEvaluator.cpp

@@ -20,7 +20,6 @@
 #include "../../../lib/CCreatureHandler.h"
 #include "../../../lib/GameLibrary.h"
 #include "../../../lib/StartInfo.h"
-#include "../../../CCallback.h"
 #include "../../../lib/filesystem/Filesystem.h"
 #include "../Goals/ExecuteHeroChain.h"
 #include "../Goals/BuildThis.h"

+ 0 - 1
AI/Nullkiller/Goals/CompleteQuest.h

@@ -10,7 +10,6 @@
 #pragma once
 
 #include "../AIUtility.h"
-#include "../../../CCallback.h"
 #include "../Goals/CGoal.h"
 #include "../../../lib/gameState/QuestInfo.h"
 

+ 1 - 1
AI/Nullkiller/Pathfinding/AINodeStorage.cpp

@@ -14,7 +14,7 @@
 #include "../Goals/Goals.h"
 #include "../AIGateway.h"
 #include "../Engine/Nullkiller.h"
-#include "../../../CCallback.h"
+#include "../../../lib/callback/IGameCallback.h"
 #include "../../../lib/mapping/CMap.h"
 #include "../../../lib/mapObjects/MapObjects.h"
 #include "../../../lib/pathfinder/CPathfinder.h"

+ 0 - 1
AI/Nullkiller/Pathfinding/AIPathfinder.cpp

@@ -10,7 +10,6 @@
 #include "StdInc.h"
 #include "AIPathfinder.h"
 #include "AIPathfinderConfig.h"
-#include "../../../CCallback.h"
 #include "../../../lib/mapping/CMap.h"
 #include "../Engine/Nullkiller.h"
 

+ 0 - 1
AI/Nullkiller/Pathfinding/Actors.cpp

@@ -11,7 +11,6 @@
 #include "Actors.h"
 #include "../AIGateway.h"
 #include "../Engine/Nullkiller.h"
-#include "../../../CCallback.h"
 #include "../../../lib/mapObjects/MapObjects.h"
 #include "../../../lib/mapping/CMapDefines.h"
 #include "../../../lib/pathfinder/TurnInfo.h"

+ 0 - 1
AI/Nullkiller/Pathfinding/GraphPaths.cpp

@@ -11,7 +11,6 @@
 #include "GraphPaths.h"
 #include "AIPathfinderConfig.h"
 #include "../../../lib/CRandomGenerator.h"
-#include "../../../CCallback.h"
 #include "../../../lib/mapObjects/CQuest.h"
 #include "../../../lib/mapping/CMap.h"
 #include "../Engine/Nullkiller.h"

+ 0 - 1
AI/Nullkiller/Pathfinding/ObjectGraph.cpp

@@ -12,7 +12,6 @@
 #include "ObjectGraphCalculator.h"
 #include "AIPathfinderConfig.h"
 #include "../../../lib/CRandomGenerator.h"
-#include "../../../CCallback.h"
 #include "../../../lib/mapping/CMap.h"
 #include "../Engine/Nullkiller.h"
 #include "../../../lib/logging/VisualLogger.h"

+ 0 - 1
AI/Nullkiller/Pathfinding/ObjectGraphCalculator.cpp

@@ -11,7 +11,6 @@
 #include "ObjectGraphCalculator.h"
 #include "AIPathfinderConfig.h"
 #include "../../../lib/CRandomGenerator.h"
-#include "../../../CCallback.h"
 #include "../../../lib/mapping/CMap.h"
 #include "../Engine/Nullkiller.h"
 #include "../../../lib/logging/VisualLogger.h"

+ 0 - 1
AI/Nullkiller/Pathfinding/Rules/AILayerTransitionRule.h

@@ -14,7 +14,6 @@
 #include "../../AIGateway.h"
 #include "../Actions/BoatActions.h"
 #include "../Actions/AdventureSpellCastMovementActions.h"
-#include "../../../../CCallback.h"
 #include "../../../../lib/mapObjects/MapObjects.h"
 #include "../../../../lib/pathfinder/PathfindingRules.h"
 

+ 0 - 1
AI/Nullkiller/Pathfinding/Rules/AIMovementAfterDestinationRule.h

@@ -12,7 +12,6 @@
 
 #include "../AINodeStorage.h"
 #include "../../AIGateway.h"
-#include "../../../../CCallback.h"
 #include "../../../../lib/mapObjects/MapObjects.h"
 #include "../../../../lib/pathfinder/PathfindingRules.h"
 

+ 0 - 1
AI/Nullkiller/Pathfinding/Rules/AIMovementToDestinationRule.h

@@ -12,7 +12,6 @@
 
 #include "../AINodeStorage.h"
 #include "../../AIGateway.h"
-#include "../../../../CCallback.h"
 #include "../../../../lib/mapObjects/MapObjects.h"
 #include "../../../../lib/pathfinder/PathfindingRules.h"
 

+ 0 - 1
AI/Nullkiller/Pathfinding/Rules/AIPreviousNodeRule.h

@@ -12,7 +12,6 @@
 
 #include "../AINodeStorage.h"
 #include "../../AIGateway.h"
-#include "../../../../CCallback.h"
 #include "../../../../lib/mapObjects/MapObjects.h"
 #include "../../../../lib/pathfinder/PathfindingRules.h"
 

+ 0 - 1
AI/Nullkiller/StdInc.h

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

+ 2 - 2
AI/StupidAI/StupidAI.cpp

@@ -8,13 +8,13 @@
  *
  */
 #include "StdInc.h"
-#include "../../lib/AI_Base.h"
 #include "StupidAI.h"
 #include "../../lib/CStack.h"
-#include "../../CCallback.h"
 #include "../../lib/CCreatureHandler.h"
 #include "../../lib/battle/BattleAction.h"
 #include "../../lib/battle/BattleInfo.h"
+#include "../../lib/battle/CPlayerBattleCallback.h"
+#include "../../lib/callback/CBattleCallback.h"
 #include "../../lib/CRandomGenerator.h"
 
 CStupidAI::CStupidAI()

+ 1 - 1
AI/StupidAI/StupidAI.h

@@ -11,7 +11,7 @@
 
 #include "../../lib/battle/BattleHex.h"
 #include "../../lib/battle/ReachabilityInfo.h"
-#include "../../lib/CGameInterface.h"
+#include "../../lib/callback/CBattleGameInterface.h"
 
 class EnemyInfo;
 

+ 0 - 1
AI/StupidAI/main.cpp

@@ -9,7 +9,6 @@
  */
 #include "StdInc.h"
 
-#include "../../lib/AI_Base.h"
 #include "StupidAI.h"
 
 #ifdef __GNUC__

+ 1 - 1
AI/VCAI/AIUtility.h

@@ -14,7 +14,7 @@
 #include "../../lib/spells/CSpellHandler.h"
 #include "../../lib/CStopWatch.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"
-#include "../../CCallback.h"
+#include "../../lib/callback/CCallback.h"
 
 class VCAI;
 class CCallback;

+ 0 - 1
AI/VCAI/ArmyManager.cpp

@@ -11,7 +11,6 @@
 #include "StdInc.h"
 #include "ArmyManager.h"
 
-#include "../../CCallback.h"
 #include "../../lib/mapObjects/MapObjects.h"
 
 void ArmyManager::init(CPlayerSpecificInfoCallback * CB)

+ 0 - 1
AI/VCAI/BuildingManager.cpp

@@ -11,7 +11,6 @@
 #include "StdInc.h"
 #include "BuildingManager.h"
 
-#include "../../CCallback.h"
 #include "../../lib/mapObjects/MapObjects.h"
 #include "../../lib/entities/building/CBuilding.h"
 

+ 1 - 1
AI/VCAI/Pathfinding/AINodeStorage.cpp

@@ -11,7 +11,7 @@
 #include "AINodeStorage.h"
 #include "Actions/TownPortalAction.h"
 #include "../Goals/Goals.h"
-#include "../../../CCallback.h"
+#include "../../../lib/callback/IGameCallback.h"
 #include "../../../lib/mapping/CMap.h"
 #include "../../../lib/mapObjects/MapObjects.h"
 #include "../../../lib/pathfinder/CPathfinder.h"

+ 0 - 1
AI/VCAI/Pathfinding/AIPathfinder.cpp

@@ -10,7 +10,6 @@
 #include "StdInc.h"
 #include "AIPathfinder.h"
 #include "AIPathfinderConfig.h"
-#include "../../../CCallback.h"
 #include "../../../lib/mapping/CMapDefines.h"
 
 #include <tbb/task_group.h>

+ 0 - 1
AI/VCAI/Pathfinding/PathfindingManager.cpp

@@ -13,7 +13,6 @@
 #include "AIPathfinderConfig.h"
 #include "../Goals/Goals.h"
 #include "../Goals/CompleteQuest.h"
-#include "../../../lib/CGameInfoCallback.h"
 #include "../../../lib/gameState/QuestInfo.h"
 #include "../../../lib/mapping/CMapDefines.h"
 #include "../../../lib/mapObjects/CQuest.h"

+ 0 - 1
AI/VCAI/Pathfinding/Rules/AILayerTransitionRule.h

@@ -13,7 +13,6 @@
 #include "../AINodeStorage.h"
 #include "../../VCAI.h"
 #include "../Actions/BoatActions.h"
-#include "../../../../CCallback.h"
 #include "../../../../lib/mapObjects/MapObjects.h"
 #include "../../../../lib/pathfinder/PathfindingRules.h"
 

+ 0 - 1
AI/VCAI/Pathfinding/Rules/AIMovementAfterDestinationRule.h

@@ -12,7 +12,6 @@
 
 #include "../AINodeStorage.h"
 #include "../../VCAI.h"
-#include "../../../../CCallback.h"
 #include "../../../../lib/mapObjects/MapObjects.h"
 #include "../../../../lib/pathfinder/PathfindingRules.h"
 

+ 0 - 1
AI/VCAI/Pathfinding/Rules/AIMovementToDestinationRule.h

@@ -12,7 +12,6 @@
 
 #include "../AINodeStorage.h"
 #include "../../VCAI.h"
-#include "../../../../CCallback.h"
 #include "../../../../lib/mapObjects/MapObjects.h"
 #include "../../../../lib/pathfinder/PathfindingRules.h"
 

+ 0 - 1
AI/VCAI/Pathfinding/Rules/AIPreviousNodeRule.h

@@ -12,7 +12,6 @@
 
 #include "../AINodeStorage.h"
 #include "../../VCAI.h"
-#include "../../../../CCallback.h"
 #include "../../../../lib/mapObjects/MapObjects.h"
 #include "../../../../lib/pathfinder/PathfindingRules.h"
 

+ 0 - 1
AI/VCAI/ResourceManager.cpp

@@ -11,7 +11,6 @@
 #include "ResourceManager.h"
 #include "Goals/Goals.h"
 
-#include "../../CCallback.h"
 #include "../../lib/mapObjects/MapObjects.h"
 
 ResourceObjective::ResourceObjective(const TResources & Res, Goals::TSubgoal Goal)

+ 1 - 0
AI/VCAI/VCAI.cpp

@@ -19,6 +19,7 @@
 #include "../../lib/CThreadHelper.h"
 #include "../../lib/UnlockGuard.h"
 #include "../../lib/StartInfo.h"
+#include "../../lib/battle/CPlayerBattleCallback.h"
 #include "../../lib/mapObjects/MapObjects.h"
 #include "../../lib/mapObjects/ObjectTemplate.h"
 #include "../../lib/CConfigHandler.h"

+ 1 - 3
AI/VCAI/VCAI.h

@@ -11,14 +11,12 @@
 
 #include "AIUtility.h"
 #include "Goals/AbstractGoal.h"
-#include "../../lib/AI_Base.h"
-#include "../../CCallback.h"
 
 #include "../../lib/ConditionalWait.h"
-
 #include "../../lib/GameConstants.h"
 #include "../../lib/GameLibrary.h"
 #include "../../lib/CCreatureHandler.h"
+#include "../../lib/callback/CAdventureAI.h"
 #include "../../lib/mapObjects/MiscObjects.h"
 #include "../../lib/spells/CSpellHandler.h"
 #include "Pathfinding/AIPathfinder.h"

+ 0 - 219
CCallback.h

@@ -1,219 +0,0 @@
-/*
- * CCallback.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
-
-#include "lib/CGameInfoCallback.h"
-#include "lib/battle/CPlayerBattleCallback.h"
-#include "lib/int3.h" // for int3
-#include "lib/networkPacks/TradeItem.h"
-
-VCMI_LIB_NAMESPACE_BEGIN
-
-class CGHeroInstance;
-class CGameState;
-struct CPath;
-class CGObjectInstance;
-class CArmedInstance;
-class BattleAction;
-class CGTownInstance;
-class IShipyard;
-struct CGPathNode;
-struct CGPath;
-struct CPathsInfo;
-class PathfinderConfig;
-struct CPack;
-struct CPackForServer;
-class IBattleEventsReceiver;
-class IGameEventsReceiver;
-struct ArtifactLocation;
-class BattleStateInfoForRetreat;
-
-VCMI_LIB_NAMESPACE_END
-
-// in static AI build this file gets included into libvcmi
-#ifdef STATIC_AI
-VCMI_LIB_USING_NAMESPACE
-#endif
-
-class CClient;
-struct lua_State;
-
-class IBattleCallback
-{
-public:
-	virtual ~IBattleCallback() = default;
-
-	bool waitTillRealize = false; //if true, request functions will return after they are realized by server
-	bool unlockGsWhenWaiting = false;//if true after sending each request, gs mutex will be unlocked so the changes can be applied; NOTICE caller must have gs mx locked prior to any call to actiob callback!
-	//battle
-	virtual void battleMakeSpellAction(const BattleID & battleID, const BattleAction & action) = 0;
-	virtual void battleMakeUnitAction(const BattleID & battleID, const BattleAction & action) = 0;
-	virtual void battleMakeTacticAction(const BattleID & battleID, const BattleAction & action) = 0;
-	virtual std::optional<BattleAction> makeSurrenderRetreatDecision(const BattleID & battleID, const BattleStateInfoForRetreat & battleState) = 0;
-
-	virtual std::shared_ptr<CPlayerBattleCallback> getBattle(const BattleID & battleID) = 0;
-	virtual std::optional<PlayerColor> getPlayerID() const = 0;
-};
-
-class IGameActionCallback
-{
-public:
-	//hero
-	virtual void moveHero(const CGHeroInstance *h, const std::vector<int3> & path, bool transit) =0; //moves hero alongside provided path
-	virtual void moveHero(const CGHeroInstance *h, const int3 & destination, bool transit) =0; //moves hero alongside provided path
-	virtual bool dismissHero(const CGHeroInstance * hero)=0; //dismisses given hero; true - successfully, false - not successfully
-	virtual void dig(const CGObjectInstance *hero)=0;
-	virtual void castSpell(const CGHeroInstance *hero, SpellID spellID, const int3 &pos = int3(-1, -1, -1))=0; //cast adventure map spell
-
-	//town
-	virtual void recruitHero(const CGObjectInstance *townOrTavern, const CGHeroInstance *hero, const HeroTypeID & nextHero=HeroTypeID::NONE)=0;
-	virtual bool buildBuilding(const CGTownInstance *town, BuildingID buildingID)=0;
-	virtual bool visitTownBuilding(const CGTownInstance *town, BuildingID buildingID)=0;
-	virtual void recruitCreatures(const CGDwelling *obj, const CArmedInstance * dst, CreatureID ID, ui32 amount, si32 level=-1)=0;
-	virtual bool upgradeCreature(const CArmedInstance *obj, SlotID stackPos, CreatureID newID=CreatureID::NONE)=0; //if newID==-1 then best possible upgrade will be made
-	virtual void spellResearch(const CGTownInstance *town, SpellID spellAtSlot, bool accepted)=0;
-	virtual void swapGarrisonHero(const CGTownInstance *town)=0;
-
-	virtual void trade(const ObjectInstanceID marketId, EMarketMode mode, TradeItemSell id1, TradeItemBuy id2, ui32 val1, const CGHeroInstance * hero)=0; //mode==0: sell val1 units of id1 resource for id2 resiurce
-	virtual void trade(const ObjectInstanceID marketId, EMarketMode mode, const std::vector<TradeItemSell> & id1, const std::vector<TradeItemBuy> & id2, const std::vector<ui32> & val1, const CGHeroInstance * hero)=0;
-
-	virtual int selectionMade(int selection, QueryID queryID) =0;
-	virtual int sendQueryReply(std::optional<int32_t> reply, QueryID queryID) =0;
-	virtual int swapCreatures(const CArmedInstance *s1, const CArmedInstance *s2, SlotID p1, SlotID p2)=0;//swaps creatures between two possibly different garrisons // TODO: AI-unsafe code - fix it!
-	virtual int mergeStacks(const CArmedInstance *s1, const CArmedInstance *s2, SlotID p1, SlotID p2)=0;//joins first stack to the second (creatures must be same type)
-	virtual int mergeOrSwapStacks(const CArmedInstance *s1, const CArmedInstance *s2, SlotID p1, SlotID p2) =0; //first goes to the second
-	virtual int splitStack(const CArmedInstance *s1, const CArmedInstance *s2, SlotID p1, SlotID p2, int val)=0;//split creatures from the first stack
-	//virtual bool swapArtifacts(const CGHeroInstance * hero1, ui16 pos1, const CGHeroInstance * hero2, ui16 pos2)=0; //swaps artifacts between two given heroes
-	virtual bool swapArtifacts(const ArtifactLocation &l1, const ArtifactLocation &l2)=0;
-	virtual void scrollBackpackArtifacts(ObjectInstanceID hero, bool left) = 0;
-	virtual void sortBackpackArtifactsBySlot(const ObjectInstanceID hero) = 0;
-	virtual void sortBackpackArtifactsByCost(const ObjectInstanceID hero) = 0;
-	virtual void sortBackpackArtifactsByClass(const ObjectInstanceID hero) = 0;
-	virtual void manageHeroCostume(ObjectInstanceID hero, size_t costumeIndex, bool saveCostume) = 0;
-	virtual void assembleArtifacts(const ObjectInstanceID & heroID, ArtifactPosition artifactSlot, bool assemble, ArtifactID assembleTo)=0;
-	virtual void eraseArtifactByClient(const ArtifactLocation & al)=0;
-	virtual bool dismissCreature(const CArmedInstance *obj, SlotID stackPos)=0;
-	virtual void saveLocalState(const JsonNode & data)=0;
-	virtual void endTurn()=0;
-	virtual void buyArtifact(const CGHeroInstance *hero, ArtifactID aid)=0; //used to buy artifacts in towns (including spell book in the guild and war machines in blacksmith)
-	virtual void setFormation(const CGHeroInstance * hero, EArmyFormation mode)=0;
-
-	virtual void save(const std::string &fname) = 0;
-	virtual void sendMessage(const std::string &mess, const CGObjectInstance * currentObject = nullptr) = 0;
-	virtual void gamePause(bool pause) = 0;
-	virtual void buildBoat(const IShipyard *obj) = 0;
-
-	// To implement high-level army management bulk actions
-	virtual int bulkMoveArmy(ObjectInstanceID srcArmy, ObjectInstanceID destArmy, SlotID srcSlot) = 0;
-	virtual int bulkSplitStack(ObjectInstanceID armyId, SlotID srcSlot, int howMany = 1) = 0;
-	virtual int bulkSplitAndRebalanceStack(ObjectInstanceID armyId, SlotID srcSlot) = 0;
-	virtual int bulkMergeStacks(ObjectInstanceID armyId, SlotID srcSlot) = 0;
-	
-	
-	// Moves all artifacts from one hero to another
-	virtual void bulkMoveArtifacts(ObjectInstanceID srcHero, ObjectInstanceID dstHero, bool swap, bool equipped, bool backpack) = 0;
-};
-
-class CBattleCallback : public IBattleCallback
-{
-	std::map<BattleID, std::shared_ptr<CPlayerBattleCallback>> activeBattles;
-
-	std::optional<PlayerColor> player;
-
-protected:
-	int sendRequest(const CPackForServer & request); //returns requestID (that'll be matched to requestID in PackageApplied)
-	CClient *cl;
-
-public:
-	CBattleCallback(std::optional<PlayerColor> player, CClient * C);
-	void battleMakeSpellAction(const BattleID & battleID, const BattleAction & action) override;//for casting spells by hero - DO NOT use it for moving active stack
-	void battleMakeUnitAction(const BattleID & battleID, const BattleAction & action) override;
-	void battleMakeTacticAction(const BattleID & battleID, const BattleAction & action) override; // performs tactic phase actions
-	std::optional<BattleAction> makeSurrenderRetreatDecision(const BattleID & battleID, const BattleStateInfoForRetreat & battleState) override;
-
-	std::shared_ptr<CPlayerBattleCallback> getBattle(const BattleID & battleID) override;
-	std::optional<PlayerColor> getPlayerID() const override;
-
-	void onBattleStarted(const IBattleInfo * info);
-	void onBattleEnded(const BattleID & battleID);
-
-	friend class CCallback;
-	friend class CClient;
-};
-
-class CCallback : public CPlayerSpecificInfoCallback, public CBattleCallback, public IGameActionCallback
-{
-	std::shared_ptr<CGameState> gamestate;
-
-	CGameState & gameState() final { return *gamestate; }
-	const CGameState & gameState() const final { return *gamestate; }
-
-public:
-	CCallback(std::shared_ptr<CGameState> gamestate, std::optional<PlayerColor> Player, CClient * C);
-	virtual ~CCallback();
-
-	//client-specific functionalities (pathfinding)
-	virtual bool canMoveBetween(const int3 &a, const int3 &b);
-	virtual int3 getGuardingCreaturePosition(int3 tile);
-
-	std::optional<PlayerColor> getPlayerID() const override;
-
-	//Set of metrhods that allows adding more interfaces for this player that'll receive game event call-ins.
-	void registerBattleInterface(std::shared_ptr<IBattleEventsReceiver> battleEvents);
-	void unregisterBattleInterface(std::shared_ptr<IBattleEventsReceiver> battleEvents);
-
-//commands
-	void moveHero(const CGHeroInstance *h, const std::vector<int3> & path, bool transit) override;
-	void moveHero(const CGHeroInstance *h, const int3 & destination, bool transit) override;
-	bool teleportHero(const CGHeroInstance *who, const CGTownInstance *where);
-	int selectionMade(int selection, QueryID queryID) override;
-	int sendQueryReply(std::optional<int32_t> reply, QueryID queryID) override;
-	int swapCreatures(const CArmedInstance *s1, const CArmedInstance *s2, SlotID p1, SlotID p2) override;
-	int mergeOrSwapStacks(const CArmedInstance *s1, const CArmedInstance *s2, SlotID p1, SlotID p2) override; //first goes to the second
-	int mergeStacks(const CArmedInstance *s1, const CArmedInstance *s2, SlotID p1, SlotID p2) override; //first goes to the second
-	int splitStack(const CArmedInstance *s1, const CArmedInstance *s2, SlotID p1, SlotID p2, int val) override;
-	int bulkMoveArmy(ObjectInstanceID srcArmy, ObjectInstanceID destArmy, SlotID srcSlot) override;
-	int bulkSplitStack(ObjectInstanceID armyId, SlotID srcSlot, int howMany = 1) override;
-	int bulkSplitAndRebalanceStack(ObjectInstanceID armyId, SlotID srcSlot) override;
-	int bulkMergeStacks(ObjectInstanceID armyId, SlotID srcSlot) override;
-	bool dismissHero(const CGHeroInstance * hero) override;
-	bool swapArtifacts(const ArtifactLocation &l1, const ArtifactLocation &l2) override;
-	void assembleArtifacts(const ObjectInstanceID & heroID, ArtifactPosition artifactSlot, bool assemble, ArtifactID assembleTo) override;
-	void bulkMoveArtifacts(ObjectInstanceID srcHero, ObjectInstanceID dstHero, bool swap, bool equipped = true, bool backpack = true) override;
-	void scrollBackpackArtifacts(ObjectInstanceID hero, bool left) override;
-	void sortBackpackArtifactsBySlot(const ObjectInstanceID hero) override;
-	void sortBackpackArtifactsByCost(const ObjectInstanceID hero) override;
-	void sortBackpackArtifactsByClass(const ObjectInstanceID hero) override;
-	void manageHeroCostume(ObjectInstanceID hero, size_t costumeIdx, bool saveCostume) override;
-	void eraseArtifactByClient(const ArtifactLocation & al) override;
-	bool buildBuilding(const CGTownInstance *town, BuildingID buildingID) override;
-	bool visitTownBuilding(const CGTownInstance *town, BuildingID buildingID) override;
-	void recruitCreatures(const CGDwelling * obj, const CArmedInstance * dst, CreatureID ID, ui32 amount, si32 level=-1) override;
-	bool dismissCreature(const CArmedInstance *obj, SlotID stackPos) override;
-	bool upgradeCreature(const CArmedInstance *obj, SlotID stackPos, CreatureID newID=CreatureID::NONE) override;
-	void saveLocalState(const JsonNode & data) override;
-	void endTurn() override;
-	void spellResearch(const CGTownInstance *town, SpellID spellAtSlot, bool accepted) override;
-	void swapGarrisonHero(const CGTownInstance *town) override;
-	void buyArtifact(const CGHeroInstance *hero, ArtifactID aid) override;
-	void trade(const ObjectInstanceID marketId, EMarketMode mode, TradeItemSell id1, TradeItemBuy id2, ui32 val1, const CGHeroInstance * hero = nullptr) override;
-	void trade(const ObjectInstanceID marketId, EMarketMode mode, const std::vector<TradeItemSell> & id1, const std::vector<TradeItemBuy> & id2, const std::vector<ui32> & val1, const CGHeroInstance * hero = nullptr) override;
-	void setFormation(const CGHeroInstance * hero, EArmyFormation mode) override;
-	void recruitHero(const CGObjectInstance *townOrTavern, const CGHeroInstance *hero, const HeroTypeID & nextHero=HeroTypeID::NONE) override;
-	void save(const std::string &fname) override;
-	void sendMessage(const std::string &mess, const CGObjectInstance * currentObject = nullptr) override;
-	void gamePause(bool pause) override;
-	void buildBoat(const IShipyard *obj) override;
-	void dig(const CGObjectInstance *hero) override;
-	void castSpell(const CGHeroInstance *hero, SpellID spellID, const int3 &pos = int3(-1, -1, -1)) override;
-
-//friends
-	friend class CClient;
-};

+ 1 - 1
client/ArtifactsUIController.cpp

@@ -18,8 +18,8 @@
 #include "widgets/CComponent.h"
 #include "windows/CWindowWithArtifacts.h"
 
-#include "../CCallback.h"
 #include "../lib/GameLibrary.h"
+#include "../lib/callback/CCallback.h"
 #include "../lib/entities/artifact/ArtifactUtils.h"
 #include "../lib/entities/artifact/CArtifact.h"
 #include "../lib/mapObjects/CGHeroInstance.h"

+ 0 - 1
client/CMakeLists.txt

@@ -1,6 +1,5 @@
 set(vcmiclientcommon_SRCS
 	StdInc.cpp
-	../CCallback.cpp
 
 	adventureMap/AdventureMapInterface.cpp
 	adventureMap/AdventureMapShortcuts.cpp

+ 5 - 2
client/CPlayerInterface.cpp

@@ -64,8 +64,7 @@
 #include "windows/InfoWindows.h"
 #include "windows/settings/SettingsMainWindow.h"
 
-#include "../CCallback.h"
-
+#include "../lib/callback/CDynLibHandler.h"
 #include "../lib/CConfigHandler.h"
 #include "../lib/texts/CGeneralTextHandler.h"
 #include "../lib/CPlayerState.h"
@@ -80,10 +79,14 @@
 #include "../lib/UnlockGuard.h"
 #include "../lib/VCMIDirs.h"
 
+#include "../lib/battle/CPlayerBattleCallback.h"
+
 #include "../lib/bonuses/Limiters.h"
 #include "../lib/bonuses/Propagators.h"
 #include "../lib/bonuses/Updaters.h"
 
+#include "../lib/callback/CCallback.h"
+
 #include "../lib/gameState/CGameState.h"
 
 #include "../lib/mapObjects/CGMarket.h"

+ 1 - 1
client/CPlayerInterface.h

@@ -11,8 +11,8 @@
 
 #include "ArtifactsUIController.h"
 
+#include "../lib/callback/CGameInterface.h"
 #include "../lib/FunctionList.h"
-#include "../lib/CGameInterface.h"
 #include "gui/CIntObject.h"
 
 VCMI_LIB_NAMESPACE_BEGIN

+ 6 - 2
client/Client.cpp

@@ -22,14 +22,18 @@
 #include "gui/WindowHandler.h"
 #include "mapView/mapHandler.h"
 
-#include "../CCallback.h"
 #include "../lib/CConfigHandler.h"
+#include "../lib/battle/BattleInfo.h"
+#include "../lib/battle/CPlayerBattleCallback.h"
+#include "../lib/callback/CCallback.h"
+#include "../lib/callback/CDynLibHandler.h"
+#include "../lib/callback/CGlobalAI.h"
+#include "../lib/callback/IGameInfoCallback.h"
 #include "../lib/gameState/CGameState.h"
 #include "../lib/CPlayerState.h"
 #include "../lib/CThreadHelper.h"
 #include "../lib/VCMIDirs.h"
 #include "../lib/UnlockGuard.h"
-#include "../lib/battle/BattleInfo.h"
 #include "../lib/serializer/Connection.h"
 #include "../lib/mapping/CMapService.h"
 #include "../lib/mapObjects/CArmedInstance.h"

+ 3 - 2
client/Client.h

@@ -12,8 +12,9 @@
 #include <memory>
 #include <vcmi/Environment.h>
 
-#include "../lib/IGameCallback.h"
+#include "../lib/callback/IGameCallback.h"
 #include "../lib/ConditionalWait.h"
+#include "../lib/ResourceSet.h"
 
 
 VCMI_LIB_NAMESPACE_BEGIN
@@ -184,7 +185,7 @@ public:
 	void showTeleportDialog(TeleportDialog * iw) override {};
 	void showObjectWindow(const CGObjectInstance * object, EOpenWindowMode window, const CGHeroInstance * visitor, bool addQuery) override {};
 	void giveResource(PlayerColor player, GameResID which, int val) override {};
-	void giveResources(PlayerColor player, TResources resources) override {};
+	void giveResources(PlayerColor player, ResourceSet resources) override {};
 
 	void giveCreatures(const CArmedInstance * objid, const CGHeroInstance * h, const CCreatureSet & creatures, bool remove) override {};
 	void takeCreatures(ObjectInstanceID objid, const std::vector<CStackBasicDescriptor> & creatures, bool forceRemoval) override {};

+ 3 - 1
client/ClientCommandManager.cpp

@@ -20,6 +20,9 @@
 #include "gui/WindowHandler.h"
 #include "render/IRenderHandler.h"
 #include "ClientNetPackVisitors.h"
+#include "../lib/callback/CCallback.h"
+#include "../lib/callback/CGlobalAI.h"
+#include "../lib/callback/CDynLibHandler.h"
 #include "../lib/CConfigHandler.h"
 #include "../lib/gameState/CGameState.h"
 #include "../lib/CPlayerState.h"
@@ -30,7 +33,6 @@
 #include "windows/CCastleInterface.h"
 #include "../lib/mapObjects/CGHeroInstance.h"
 #include "render/CAnimation.h"
-#include "../CCallback.h"
 #include "../lib/texts/CGeneralTextHandler.h"
 #include "../lib/filesystem/Filesystem.h"
 #include "../lib/modding/CModHandler.h"

+ 1 - 2
client/GameChatHandler.cpp

@@ -19,8 +19,7 @@
 
 #include "adventureMap/CInGameConsole.h"
 
-#include "../CCallback.h"
-
+#include "../lib/callback/CCallback.h"
 #include "../lib/networkPacks/PacksForLobby.h"
 #include "../lib/mapObjects/CArmedInstance.h"
 #include "../lib/CConfigHandler.h"

+ 1 - 2
client/HeroMovementController.cpp

@@ -20,11 +20,10 @@
 #include "mapView/mapHandler.h"
 #include "media/ISoundPlayer.h"
 
-#include "../CCallback.h"
-
 #include "../lib/ConditionalWait.h"
 #include "../lib/CConfigHandler.h"
 #include "../lib/CRandomGenerator.h"
+#include "../lib/callback/CCallback.h"
 #include "../lib/pathfinder/CGPathNode.h"
 #include "../lib/mapObjects/CGHeroInstance.h"
 #include "../lib/networkPacks/PacksForClient.h"

+ 1 - 1
client/NetPacksClient.cpp

@@ -28,7 +28,7 @@
 #include "CServerHandler.h"
 #include "UIHelper.h"
 
-#include "../CCallback.h"
+#include "../lib/callback/CCallback.h"
 #include "../lib/filesystem/Filesystem.h"
 #include "../lib/filesystem/FileInfo.h"
 #include "../lib/serializer/Connection.h"

+ 1 - 1
client/PlayerLocalState.cpp

@@ -10,7 +10,7 @@
 #include "StdInc.h"
 #include "PlayerLocalState.h"
 
-#include "../CCallback.h"
+#include "../lib/callback/CCallback.h"
 #include "../lib/json/JsonNode.h"
 #include "../lib/mapObjects/CGHeroInstance.h"
 #include "../lib/mapObjects/CGTownInstance.h"

+ 1 - 1
client/adventureMap/AdventureMapInterface.cpp

@@ -37,9 +37,9 @@
 #include "../PlayerLocalState.h"
 #include "../CPlayerInterface.h"
 
-#include "../../CCallback.h"
 #include "../../lib/IGameSettings.h"
 #include "../../lib/StartInfo.h"
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/spells/CSpellHandler.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"

+ 1 - 1
client/adventureMap/AdventureMapShortcuts.cpp

@@ -30,9 +30,9 @@
 #include "AdventureOptions.h"
 #include "AdventureState.h"
 
-#include "../../CCallback.h"
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/CPlayerState.h"
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"
 #include "../../lib/mapObjects/CGTownInstance.h"

+ 1 - 1
client/adventureMap/AdventureOptions.cpp

@@ -21,9 +21,9 @@
 #include "../gui/Shortcut.h"
 #include "../widgets/Buttons.h"
 
-#include "../../CCallback.h"
 #include "../../lib/GameLibrary.h"
 #include "../../lib/StartInfo.h"
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 
 AdventureOptions::AdventureOptions()

+ 0 - 1
client/adventureMap/CInGameConsole.cpp

@@ -27,7 +27,6 @@
 #include "../adventureMap/AdventureMapInterface.h"
 #include "../windows/CMessage.h"
 
-#include "../../CCallback.h"
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/CThreadHelper.h"
 #include "../../lib/mapObjects/CArmedInstance.h"

+ 1 - 1
client/adventureMap/CInfoBar.cpp

@@ -27,9 +27,9 @@
 #include "../media/ISoundPlayer.h"
 #include "../render/IScreenHandler.h"
 
-#include "../../CCallback.h"
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/GameLibrary.h"
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"
 #include "../../lib/mapObjects/CGTownInstance.h"

+ 1 - 2
client/adventureMap/CList.cpp

@@ -28,14 +28,13 @@
 #include "../render/Canvas.h"
 #include "../render/Colors.h"
 
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/IGameSettings.h"
 #include "../../lib/GameLibrary.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"
 #include "../../lib/mapObjects/CGTownInstance.h"
 
-#include "../../CCallback.h"
-
 CList::CListItem::CListItem(CList * Parent)
 	: CIntObject(LCLICK | SHOW_POPUP | HOVER),
 	parent(Parent),

+ 1 - 1
client/adventureMap/CMinimap.cpp

@@ -24,7 +24,7 @@
 #include "../render/Graphics.h"
 #include "../windows/InfoWindows.h"
 
-#include "../../CCallback.h"
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/TerrainHandler.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"

+ 1 - 1
client/adventureMap/CResDataBar.cpp

@@ -19,8 +19,8 @@
 #include "../gui/TextAlignment.h"
 #include "../widgets/Images.h"
 
-#include "../../CCallback.h"
 #include "../../lib/CConfigHandler.h"
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/ResourceSet.h"
 #include "../../lib/GameLibrary.h"

+ 1 - 1
client/adventureMap/MapAudioPlayer.cpp

@@ -10,7 +10,6 @@
 #include "StdInc.h"
 #include "MapAudioPlayer.h"
 
-#include "../CCallback.h"
 #include "../CPlayerInterface.h"
 #include "../GameEngine.h"
 #include "../GameInstance.h"
@@ -20,6 +19,7 @@
 
 #include "../../lib/CRandomGenerator.h"
 #include "../../lib/TerrainHandler.h"
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/mapObjects/CArmedInstance.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"
 #include "../../lib/mapping/CMap.h"

+ 2 - 1
client/adventureMap/TurnTimerWidget.cpp

@@ -21,10 +21,11 @@
 #include "../widgets/GraphicalPrimitiveCanvas.h"
 #include "../widgets/TextControls.h"
 
-#include "../../CCallback.h"
 #include "../../lib/CPlayerState.h"
 #include "../../lib/CStack.h"
 #include "../../lib/StartInfo.h"
+#include "../../lib/battle/CPlayerBattleCallback.h"
+#include "../../lib/callback/CCallback.h"
 
 TurnTimerWidget::TurnTimerWidget(const Point & position)
 	: TurnTimerWidget(position, PlayerColor::NEUTRAL)

+ 2 - 1
client/battle/BattleActionsController.cpp

@@ -26,13 +26,14 @@
 #include "../windows/CCreatureWindow.h"
 #include "../windows/InfoWindows.h"
 
-#include "../../CCallback.h"
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/GameLibrary.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/CRandomGenerator.h"
 #include "../../lib/CStack.h"
 #include "../../lib/battle/BattleAction.h"
+#include "../../lib/battle/CPlayerBattleCallback.h"
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/spells/CSpellHandler.h"
 #include "../../lib/spells/ISpellMechanics.h"
 #include "../../lib/spells/Problem.h"

+ 1 - 1
client/battle/BattleAnimationClasses.cpp

@@ -26,7 +26,7 @@
 #include "../render/CAnimation.h"
 #include "../render/IRenderHandler.h"
 
-#include "../../CCallback.h"
+#include "../../lib/battle/CPlayerBattleCallback.h"
 #include "../../lib/CStack.h"
 
 BattleAnimation::BattleAnimation(BattleInterface & owner)

+ 1 - 3
client/battle/BattleEffectsController.cpp

@@ -25,12 +25,10 @@
 #include "../render/CAnimation.h"
 #include "../render/Graphics.h"
 
-#include "../../CCallback.h"
-
 #include "../../lib/CStack.h"
 #include "../../lib/GameLibrary.h"
-#include "../../lib/IGameEventsReceiver.h"
 #include "../../lib/battle/BattleAction.h"
+#include "../../lib/battle/CPlayerBattleCallback.h"
 #include "../../lib/filesystem/ResourcePath.h"
 #include "../../lib/networkPacks/PacksForClientBattle.h"
 #include "../../lib/texts/CGeneralTextHandler.h"

+ 1 - 1
client/battle/BattleFieldController.cpp

@@ -32,10 +32,10 @@
 #include "../adventureMap/CInGameConsole.h"
 #include "../client/render/CAnimation.h"
 
-#include "../../CCallback.h"
 #include "../../lib/BattleFieldHandler.h"
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/CStack.h"
+#include "../../lib/battle/CPlayerBattleCallback.h"
 #include "../../lib/spells/ISpellMechanics.h"
 
 namespace HexMasks

+ 2 - 1
client/battle/BattleInterface.cpp

@@ -34,7 +34,6 @@
 #include "../render/Canvas.h"
 #include "../adventureMap/AdventureMapInterface.h"
 
-#include "../../CCallback.h"
 
 #include "../../lib/BattleFieldHandler.h"
 #include "../../lib/CConfigHandler.h"
@@ -43,6 +42,8 @@
 #include "../../lib/GameLibrary.h"
 #include "../../lib/TerrainHandler.h"
 #include "../../lib/UnlockGuard.h"
+#include "../../lib/battle/CPlayerBattleCallback.h"
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/gameState/InfoAboutArmy.h"
 #include "../../lib/mapObjects/CGTownInstance.h"
 #include "../../lib/networkPacks/PacksForClientBattle.h"

+ 2 - 1
client/battle/BattleInterfaceClasses.cpp

@@ -46,10 +46,11 @@
 #include "../adventureMap/CInGameConsole.h"
 #include "../eventsSDL/InputHandler.h"
 
-#include "../../CCallback.h"
 #include "../../lib/CStack.h"
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/CCreatureHandler.h"
+#include "../../lib/battle/CPlayerBattleCallback.h"
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/entities/hero/CHeroClass.h"
 #include "../../lib/entities/hero/CHero.h"
 #include "../../lib/GameLibrary.h"

+ 1 - 1
client/battle/BattleObstacleController.cpp

@@ -24,9 +24,9 @@
 #include "../render/Canvas.h"
 #include "../render/IRenderHandler.h"
 
-#include "../../CCallback.h"
 #include "../../lib/battle/CObstacleInstance.h"
 #include "../../lib/ObstacleHandler.h"
+#include "../../lib/battle/CPlayerBattleCallback.h"
 #include "../../lib/serializer/JsonDeserializer.h"
 
 BattleObstacleController::BattleObstacleController(BattleInterface & owner):

+ 1 - 1
client/battle/BattleSiegeController.cpp

@@ -24,8 +24,8 @@
 #include "../render/IImage.h"
 #include "../render/IRenderHandler.h"
 
-#include "../../CCallback.h"
 #include "../../lib/CStack.h"
+#include "../../lib/battle/CPlayerBattleCallback.h"
 #include "../../lib/entities/building/TownFortifications.h"
 #include "../../lib/mapObjects/CGTownInstance.h"
 #include "../../lib/networkPacks/PacksForClientBattle.h"

+ 1 - 2
client/battle/BattleStacksController.cpp

@@ -32,14 +32,13 @@
 #include "../render/Graphics.h"
 #include "../render/IFont.h"
 
-#include "../../CCallback.h"
-
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/CRandomGenerator.h"
 #include "../../lib/CStack.h"
 #include "../../lib/GameLibrary.h"
 #include "../../lib/battle/BattleAction.h"
 #include "../../lib/battle/BattleHex.h"
+#include "../../lib/battle/CPlayerBattleCallback.h"
 #include "../../lib/spells/ISpellMechanics.h"
 #include "../../lib/texts/TextOperations.h"
 

+ 3 - 2
client/battle/BattleWindow.cpp

@@ -34,14 +34,15 @@
 #include "../adventureMap/TurnTimerWidget.h"
 #include "../windows/settings/SettingsMainWindow.h"
 
-#include "../../CCallback.h"
-
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/CPlayerState.h"
 #include "../../lib/CStack.h"
 #include "../../lib/GameLibrary.h"
 #include "../../lib/StartInfo.h"
 #include "../../lib/battle/BattleInfo.h"
+#include "../../lib/battle/CPlayerBattleCallback.h"
+#include "../../lib/callback/CCallback.h"
+#include "../../lib/callback/CDynLibHandler.h"
 #include "../../lib/entities/artifact/CArtHandler.h"
 #include "../../lib/filesystem/ResourcePath.h"
 #include "../../lib/gameState/InfoAboutArmy.h"

+ 1 - 1
client/lobby/CCampaignInfoScreen.cpp

@@ -11,7 +11,7 @@
 
 #include "CCampaignInfoScreen.h"
 
-#include "../../CCallback.h"
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/StartInfo.h"
 #include "../../lib/mapping/CMapInfo.h"

+ 0 - 2
client/lobby/CLobbyScreen.cpp

@@ -27,8 +27,6 @@
 #include "../render/Colors.h"
 #include "../globalLobby/GlobalLobbyClient.h"
 
-#include "../../CCallback.h"
-
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/campaign/CampaignHandler.h"

+ 1 - 1
client/lobby/CSavingScreen.cpp

@@ -19,8 +19,8 @@
 #include "../widgets/Buttons.h"
 #include "../widgets/CTextInput.h"
 
-#include "../../CCallback.h"
 #include "../../lib/CConfigHandler.h"
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/StartInfo.h"
 #include "../../lib/filesystem/Filesystem.h"

+ 1 - 2
client/lobby/CScenarioInfoScreen.cpp

@@ -18,8 +18,7 @@
 #include "../gui/Shortcut.h"
 #include "../widgets/Buttons.h"
 
-#include "../../CCallback.h"
-
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/StartInfo.h"
 #include "../../lib/mapping/CMapInfo.h"

+ 0 - 2
client/lobby/CSelectionBase.cpp

@@ -16,8 +16,6 @@
 #include "RandomMapTab.h"
 #include "SelectionTab.h"
 
-#include "../../CCallback.h"
-
 #include "../CPlayerInterface.h"
 #include "../CServerHandler.h"
 #include "../GameEngine.h"

+ 0 - 2
client/lobby/SelectionTab.cpp

@@ -33,8 +33,6 @@
 #include "../render/IImage.h"
 #include "../render/IRenderHandler.h"
 
-#include "../../CCallback.h"
-
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/IGameSettings.h"
 #include "../../lib/filesystem/Filesystem.h"

+ 0 - 2
client/mainmenu/CMainMenu.cpp

@@ -45,8 +45,6 @@
 #include "../Client.h"
 #include "../CMT.h"
 
-#include "../../CCallback.h"
-
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/campaign/CampaignHandler.h"
 #include "../../lib/filesystem/Filesystem.h"

+ 0 - 2
client/mapView/MapRenderer.cpp

@@ -22,8 +22,6 @@
 #include "../render/Colors.h"
 #include "../render/Graphics.h"
 
-#include "../../CCallback.h"
-
 #include "../../lib/RiverHandler.h"
 #include "../../lib/RoadHandler.h"
 #include "../../lib/TerrainHandler.h"

+ 1 - 1
client/mapView/MapRendererContext.cpp

@@ -14,12 +14,12 @@
 #include "MapRendererContextState.h"
 #include "mapHandler.h"
 
-#include "../../CCallback.h"
 #include "../CPlayerInterface.h"
 #include "../PlayerLocalState.h"
 #include "../GameInstance.h"
 
 #include "../../lib/Point.h"
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"
 #include "../../lib/mapObjects/MiscObjects.h"
 #include "../../lib/spells/CSpellHandler.h"

+ 1 - 1
client/mapView/MapRendererContextState.cpp

@@ -14,11 +14,11 @@
 #include "IMapRendererContext.h"
 #include "mapHandler.h"
 
-#include "../../CCallback.h"
 #include "../CPlayerInterface.h"
 #include "../GameInstance.h"
 #include "../adventureMap/AdventureMapInterface.h"
 
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"
 #include "../../lib/mapping/CMap.h"
 

+ 1 - 2
client/mapView/MapView.cpp

@@ -26,8 +26,7 @@
 #include "../render/IImage.h"
 #include "../eventsSDL/InputHandler.h"
 
-#include "../../CCallback.h"
-
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"
 

+ 1 - 1
client/mapView/MapViewController.cpp

@@ -16,7 +16,6 @@
 #include "MapViewCache.h"
 #include "MapViewModel.h"
 
-#include "../CCallback.h"
 #include "../CPlayerInterface.h"
 #include "../adventureMap/AdventureMapInterface.h"
 #include "../GameEngine.h"
@@ -27,6 +26,7 @@
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/StartInfo.h"
 #include "../../lib/UnlockGuard.h"
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"
 #include "../../lib/mapObjects/MiscObjects.h"
 #include "../../lib/pathfinder/CGPathNode.h"

+ 2 - 1
client/mapView/mapHandler.cpp

@@ -12,13 +12,14 @@
 #include "IMapRendererObserver.h"
 #include "mapHandler.h"
 
-#include "../CCallback.h"
 #include "../CPlayerInterface.h"
 #include "../GameEngine.h"
 #include "../GameInstance.h"
 
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/TerrainHandler.h"
+#include "../../lib/callback/CCallback.h"
+#include "../../lib/callback/IGameInfoCallback.h"
 #include "../../lib/mapObjectConstructors/CObjectClassesHandler.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"
 #include "../../lib/mapObjects/ObjectTemplate.h"

+ 0 - 2
client/widgets/CArtifactsOfHeroAltar.cpp

@@ -13,8 +13,6 @@
 #include "Buttons.h"
 #include "../CPlayerInterface.h"
 
-#include "../../CCallback.h"
-
 #include "../../lib/mapObjects/CGHeroInstance.h"
 #include "../../lib/networkPacks/ArtifactLocation.h"
 

+ 1 - 2
client/widgets/CArtifactsOfHeroBackpack.cpp

@@ -20,11 +20,10 @@
 #include "../CPlayerInterface.h"
 #include "../../lib/entities/artifact/ArtifactUtils.h"
 #include "../../lib/entities/artifact/CArtifact.h"
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"
 #include "../../lib/networkPacks/ArtifactLocation.h"
 
-#include "../../CCallback.h"
-
 CArtifactsOfHeroBackpack::CArtifactsOfHeroBackpack(size_t slotsColumnsMax, size_t slotsRowsMax)
 	: slotsColumnsMax(slotsColumnsMax)
 	, slotsRowsMax(slotsRowsMax)

+ 1 - 1
client/widgets/CArtifactsOfHeroBase.cpp

@@ -18,7 +18,7 @@
 
 #include "../CPlayerInterface.h"
 
-#include "../../CCallback.h"
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/entities/artifact/ArtifactUtils.h"
 #include "../../lib/entities/artifact/CArtifact.h"
 #include "../../lib/entities/artifact/CArtifactFittingSet.h"

+ 0 - 1
client/widgets/CArtifactsOfHeroKingdom.cpp

@@ -15,7 +15,6 @@
 #include "../CPlayerInterface.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"
 
-#include "../../CCallback.h"
 #include "../../lib/networkPacks/ArtifactLocation.h"
 
 CArtifactsOfHeroKingdom::CArtifactsOfHeroKingdom(ArtPlaceMap ArtWorn, std::vector<ArtPlacePtr> Backpack,

+ 1 - 2
client/widgets/CArtifactsOfHeroMain.cpp

@@ -14,9 +14,8 @@
 #include "../GameInstance.h"
 
 #include "../CPlayerInterface.h"
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"
-
-#include "../../CCallback.h"
 #include "../../lib/networkPacks/ArtifactLocation.h"
 
 CArtifactsOfHeroMain::CArtifactsOfHeroMain(const Point & position)

+ 1 - 2
client/widgets/CComponentHolder.cpp

@@ -22,11 +22,10 @@
 #include "../render/IRenderHandler.h"
 #include "../CPlayerInterface.h"
 
-#include "../../CCallback.h"
-
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/CSkillHandler.h"
 #include "../../lib/GameLibrary.h"
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/entities/artifact/ArtifactUtils.h"
 #include "../../lib/entities/artifact/CArtifact.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"

+ 1 - 2
client/widgets/CExchangeController.cpp

@@ -15,8 +15,7 @@
 
 #include "../widgets/CGarrisonInt.h"
 
-#include "../../CCallback.h"
-
+#include "../lib/callback/CCallback.h"
 #include "../lib/mapObjects/CGHeroInstance.h"
 
 CExchangeController::CExchangeController(ObjectInstanceID hero1, ObjectInstanceID hero2)

+ 1 - 2
client/widgets/CGarrisonInt.cpp

@@ -23,13 +23,12 @@
 #include "../windows/GUIClasses.h"
 #include "../CPlayerInterface.h"
 
-#include "../../CCallback.h"
-
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/texts/TextOperations.h"
 #include "../../lib/CCreatureHandler.h"
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/GameLibrary.h"
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/entities/artifact/ArtifactUtils.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"
 #include "../../lib/networkPacks/ArtifactLocation.h"

+ 0 - 2
client/widgets/Images.cpp

@@ -25,8 +25,6 @@
 
 #include "../CPlayerInterface.h"
 
-#include "../../CCallback.h"
-
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/texts/CGeneralTextHandler.h" //for Unicode related stuff
 #include "../../lib/CRandomGenerator.h"

+ 1 - 2
client/widgets/MiscWidgets.cpp

@@ -29,11 +29,10 @@
 #include "../windows/InfoWindows.h"
 #include "../render/Canvas.h"
 
-#include "../../CCallback.h"
-
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/IGameSettings.h"
 #include "../../lib/GameLibrary.h"
+#include "../../lib/callback/CCallback.h"
 #include "../../lib/entities/faction/CTownHandler.h"
 #include "../../lib/gameState/InfoAboutArmy.h"
 #include "../../lib/mapObjects/CGCreature.h"

+ 1 - 2
client/widgets/markets/CAltarArtifacts.cpp

@@ -19,9 +19,8 @@
 
 #include "../../CPlayerInterface.h"
 
-#include "../../../CCallback.h"
-
 #include "../../../lib/GameLibrary.h"
+#include "../../../lib/callback/CCallback.h"
 #include "../../../lib/entities/artifact/CArtifact.h"
 #include "../../../lib/networkPacks/ArtifactLocation.h"
 #include "../../../lib/texts/CGeneralTextHandler.h"

+ 1 - 2
client/widgets/markets/CAltarCreatures.cpp

@@ -19,9 +19,8 @@
 
 #include "../../CPlayerInterface.h"
 
-#include "../../../CCallback.h"
-
 #include "../../../lib/GameLibrary.h"
+#include "../../../lib/callback/CCallback.h"
 #include "../../../lib/texts/CGeneralTextHandler.h"
 #include "../../../lib/mapObjects/CGHeroInstance.h"
 #include "../../../lib/mapObjects/IMarket.h"

部分文件因文件數量過多而無法顯示