1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +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

@@ -25,20 +25,20 @@ public:
MOCK_CONST_METHOD0(getDefendedTown, const CGTownInstance *());
MOCK_CONST_METHOD1(getWallState, EWallState(EWallPart));
MOCK_CONST_METHOD0(getGateState, EGateState());
MOCK_CONST_METHOD1(getSidePlayer, PlayerColor(ui8));
MOCK_CONST_METHOD1(getSideArmy, const CArmedInstance *(ui8));
MOCK_CONST_METHOD1(getSideHero, const CGHeroInstance *(ui8));
MOCK_CONST_METHOD1(getCastSpells, uint32_t(ui8));
MOCK_CONST_METHOD1(getEnchanterCounter, int32_t(ui8));
MOCK_CONST_METHOD1(getSidePlayer, PlayerColor(BattleSide));
MOCK_CONST_METHOD1(getSideArmy, const CArmedInstance *(BattleSide));
MOCK_CONST_METHOD1(getSideHero, const CGHeroInstance *(BattleSide));
MOCK_CONST_METHOD1(getCastSpells, uint32_t(BattleSide));
MOCK_CONST_METHOD1(getEnchanterCounter, int32_t(BattleSide));
MOCK_CONST_METHOD0(getTacticDist, ui8());
MOCK_CONST_METHOD0(getTacticsSide, ui8());
MOCK_CONST_METHOD0(getTacticsSide, BattleSide());
MOCK_CONST_METHOD0(getBonusBearer, const IBonusBearer *());
MOCK_CONST_METHOD0(nextUnitId, uint32_t());
MOCK_CONST_METHOD3(getActualDamage, int64_t(const DamageRange &, int32_t, vstd::RNG &));
MOCK_CONST_METHOD0(getBattleID, BattleID());
MOCK_CONST_METHOD0(getLocation, int3());
MOCK_CONST_METHOD0(isCreatureBank, bool());
MOCK_CONST_METHOD1(getUsedSpells, std::vector<SpellID>(ui8));
MOCK_CONST_METHOD1(getUsedSpells, std::vector<SpellID>(BattleSide));
MOCK_METHOD0(nextRound, void());
MOCK_METHOD1(nextTurn, void(uint32_t));