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

EWallPart & EWallState are now enum class

This commit is contained in:
Ivan Savenko
2023-01-13 00:35:58 +02:00
parent b86704bece
commit 500cf7f15d
22 changed files with 84 additions and 101 deletions

View File

@@ -46,14 +46,14 @@ std::vector<BattleHex> CBattleAI::getBrokenWallMoatHexes() const
{
std::vector<BattleHex> result;
for(int wallPart = EWallPart::BOTTOM_WALL; wallPart < EWallPart::UPPER_WALL; wallPart++)
for(EWallPart wallPart : { EWallPart::BOTTOM_WALL, EWallPart::BELOW_GATE, EWallPart::OVER_GATE, EWallPart::UPPER_WALL })
{
auto state = cb->battleGetWallState(wallPart);
if(state != EWallState::DESTROYED)
continue;
auto wallHex = cb->wallPartToBattleHex((EWallPart::EWallPart)wallPart);
auto wallHex = cb->wallPartToBattleHex((EWallPart)wallPart);
auto moatHex = wallHex.cloneInDirection(BattleHex::LEFT);
result.push_back(moatHex);
@@ -364,7 +364,7 @@ BattleAction CBattleAI::useCatapult(const CStack * stack)
}
else
{
EWallPart::EWallPart wallParts[] = {
EWallPart wallParts[] = {
EWallPart::KEEP,
EWallPart::BOTTOM_TOWER,
EWallPart::UPPER_TOWER,