1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

vcmi: use enum class for EComponentType

There is really no reason not to use it
This commit is contained in:
Konstantin
2023-03-10 15:54:12 +03:00
parent 2bd74e5c67
commit bc228a938a
15 changed files with 148 additions and 86 deletions

View File

@@ -1735,31 +1735,31 @@ void CTownBonus::onHeroVisit (const CGHeroInstance * h) const
case BuildingSubID::KNOWLEDGE_VISITING_BONUS: //wall of knowledge
what = PrimarySkill::KNOWLEDGE;
val = 1;
iw.components.emplace_back(Component::PRIM_SKILL, 3, 1, 0);
iw.components.emplace_back(Component::EComponentType::PRIM_SKILL, 3, 1, 0);
break;
case BuildingSubID::SPELL_POWER_VISITING_BONUS: //order of fire
what = PrimarySkill::SPELL_POWER;
val = 1;
iw.components.emplace_back(Component::PRIM_SKILL, 2, 1, 0);
iw.components.emplace_back(Component::EComponentType::PRIM_SKILL, 2, 1, 0);
break;
case BuildingSubID::ATTACK_VISITING_BONUS: //hall of Valhalla
what = PrimarySkill::ATTACK;
val = 1;
iw.components.emplace_back(Component::PRIM_SKILL, 0, 1, 0);
iw.components.emplace_back(Component::EComponentType::PRIM_SKILL, 0, 1, 0);
break;
case BuildingSubID::EXPERIENCE_VISITING_BONUS: //academy of battle scholars
what = PrimarySkill::EXPERIENCE;
val = static_cast<int>(h->calculateXp(1000));
iw.components.emplace_back(Component::EXPERIENCE, 0, val, 0);
iw.components.emplace_back(Component::EComponentType::EXPERIENCE, 0, val, 0);
break;
case BuildingSubID::DEFENSE_VISITING_BONUS: //cage of warlords
what = PrimarySkill::DEFENSE;
val = 1;
iw.components.emplace_back(Component::PRIM_SKILL, 1, 1, 0);
iw.components.emplace_back(Component::EComponentType::PRIM_SKILL, 1, 1, 0);
break;
case BuildingSubID::CUSTOM_VISITING_BONUS: