1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Separated battlefield background&hexes handling into a new class

This commit is contained in:
Ivan Savenko
2022-11-17 23:57:51 +02:00
parent 9c2a6dc9fc
commit 3c5858f01e
13 changed files with 766 additions and 670 deletions

View File

@@ -13,6 +13,7 @@
#include "windows/CAdvmapInterface.h"
#include "battle/CBattleInterface.h"
#include "battle/CBattleFieldController.h"
#include "battle/CBattleInterfaceClasses.h"
#include "../CCallback.h"
#include "windows/CCastleInterface.h"
@@ -794,8 +795,6 @@ void CPlayerInterface::battleObstaclesChanged(const std::vector<ObstacleChanges>
EVENT_HANDLER_CALLED_BY_CLIENT;
BATTLE_EVENT_POSSIBLE_RETURN;
bool needUpdate = false;
for(auto & change : obstacles)
{
if(change.operation == BattleChanges::EOperation::ADD)
@@ -808,13 +807,9 @@ void CPlayerInterface::battleObstaclesChanged(const std::vector<ObstacleChanges>
}
else
{
needUpdate = true;
battleInt->fieldController->redrawBackgroundWithHexes(battleInt->activeStack);
}
}
if(needUpdate)
//update accessible hexes
battleInt->redrawBackgroundWithHexes(battleInt->activeStack);
}
void CPlayerInterface::battleCatapultAttacked(const CatapultAttack & ca)