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

Unified handling of battle sides ID's

- Replaced BattleSide namespace-enum with enum class
- Merged two different BattleSide enum's into one
- Merged BattlePerspective enum into BattleSide enum
- Changed all places that use integers to represent battle side to use
BattleSide enum
- Added BattleSideArray convenience wrapper for std::array that is
always 2-elements in size and allows access to its elements using
BattleSide enum
This commit is contained in:
Ivan Savenko
2024-08-11 20:22:35 +00:00
parent 9b914bb4db
commit 2a05fbdd50
95 changed files with 601 additions and 568 deletions

View File

@@ -52,7 +52,7 @@ std::vector<BattleHex> CObstacleInstance::getAffectedTiles() const
}
}
bool CObstacleInstance::visibleForSide(ui8 side, bool hasNativeStack) const
bool CObstacleInstance::visibleForSide(BattleSide side, bool hasNativeStack) const
{
//by default obstacle is visible for everyone
return true;
@@ -134,7 +134,7 @@ SpellCreatedObstacle::SpellCreatedObstacle()
: turnsRemaining(-1),
casterSpellPower(0),
spellLevel(0),
casterSide(0),
casterSide(BattleSide::NONE),
hidden(false),
passable(false),
trigger(false),
@@ -148,7 +148,7 @@ SpellCreatedObstacle::SpellCreatedObstacle()
obstacleType = SPELL_CREATED;
}
bool SpellCreatedObstacle::visibleForSide(ui8 side, bool hasNativeStack) const
bool SpellCreatedObstacle::visibleForSide(BattleSide side, bool hasNativeStack) const
{
//we hide mines and not discovered quicksands
//quicksands are visible to the caster or if owned unit stepped into that particular patch