1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +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

@ -116,9 +116,9 @@ void CRandomRewardObjectInfo::configureReward(CRewardableObject * object, CRando
bonus.sid = object->ID;
//TODO: bonus.description = object->getObjectName();
if (bonus.type == Bonus::MORALE)
reward.extraComponents.emplace_back(Component::MORALE, 0, bonus.val, 0);
reward.extraComponents.emplace_back(Component::EComponentType::MORALE, 0, bonus.val, 0);
if (bonus.type == Bonus::LUCK)
reward.extraComponents.emplace_back(Component::LUCK, 0, bonus.val, 0);
reward.extraComponents.emplace_back(Component::EComponentType::LUCK, 0, bonus.val, 0);
}
reward.primary = JsonRandom::loadPrimary(source["primary"], rng);
@ -137,7 +137,7 @@ void CRandomRewardObjectInfo::configureReward(CRewardableObject * object, CRando
CreatureID from (VLC->modh->identifiers.getIdentifier (node.second.meta, "creature", node.first) .get());
CreatureID dest (VLC->modh->identifiers.getIdentifier (node.second.meta, "creature", node.second.String()).get());
reward.extraComponents.emplace_back(Component::CREATURE, dest.getNum(), 0, 0);
reward.extraComponents.emplace_back(Component::EComponentType::CREATURE, dest.getNum(), 0, 0);
reward.creaturesChange[from] = dest;
}