1
0
mirror of https://github.com/vcmi/vcmi.git synced 2026-05-22 09:55:17 +02:00

Reduced usage of global variables - removed or made const / constexpr

This commit is contained in:
Ivan Savenko
2024-02-12 13:49:45 +02:00
parent 6e399eb21a
commit 4c70abbeb5
24 changed files with 39 additions and 99 deletions
-2
View File
@@ -49,7 +49,6 @@ CBattleAI::~CBattleAI()
void CBattleAI::initBattleInterface(std::shared_ptr<Environment> ENV, std::shared_ptr<CBattleCallback> CB)
{
setCbc(CB);
env = ENV;
cb = CB;
playerID = *CB->getPlayerID();
@@ -121,7 +120,6 @@ void CBattleAI::activeStack(const BattleID & battleID, const CStack * stack )
};
BattleAction result = BattleAction::makeDefend(stack);
setCbc(cb); //TODO: make solid sure that AIs always use their callbacks (need to take care of event handlers too)
auto start = std::chrono::high_resolution_clock::now();