1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Remove most of non-const access to VLC entities

This commit is contained in:
Ivan Savenko
2023-12-31 23:43:35 +02:00
parent bd5682ecc3
commit d5c4478816
55 changed files with 236 additions and 305 deletions

View File

@@ -57,7 +57,7 @@ public:
std::vector<InitialArmyStack> initialArmy;
CHeroClass * heroClass{};
const CHeroClass * heroClass = nullptr;
std::vector<std::pair<SecondarySkill, ui8> > secSkillsInit; //initial secondary skills; first - ID of skill, second - level of skill (1 - basic, 2 - adv., 3 - expert)
BonusList specialty;
std::set<SpellID> spells;
@@ -121,7 +121,7 @@ public:
// resulting chance = sqrt(town.chance * heroClass.chance)
ui32 defaultTavernChance;
CCreature * commander;
const CCreature * commander;
std::vector<int> primarySkillInitial; // initial primary skills
std::vector<int> primarySkillLowLevel; // probability (%) of getting point of primary skill when getting level
@@ -154,6 +154,8 @@ public:
void serializeJson(JsonSerializeFormat & handler);
EAlignment getAlignment() const;
int tavernProbability(FactionID faction) const;
};
class DLL_LINKAGE CHeroClassHandler : public CHandlerBase<HeroClassID, HeroClass, CHeroClass, HeroClassService>
@@ -189,8 +191,6 @@ class DLL_LINKAGE CHeroHandler : public CHandlerBase<HeroTypeID, HeroType, CHero
std::vector<std::function<void()>> callAfterLoadFinalization;
public:
CHeroClassHandler classes;
ui32 level(TExpType experience) const; //calculates level corresponding to given experience amount
TExpType reqExp(ui32 level) const; //calculates experience required for given level
ui32 maxSupportedLevel() const;