diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-06 18:37:06 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-06 18:37:06 +0300 |
commit | c25141f02a5b3dcddcc93ca5d2bd2fcdad5efb31 (patch) | |
tree | ac124c630bc17ef10a8885a49fbb387f7091d15d /src/statuseffect.cpp | |
parent | 88697bc3503090194877b241b987ddc751034166 (diff) | |
download | manaplus-c25141f02a5b3dcddcc93ca5d2bd2fcdad5efb31.tar.gz manaplus-c25141f02a5b3dcddcc93ca5d2bd2fcdad5efb31.tar.bz2 manaplus-c25141f02a5b3dcddcc93ca5d2bd2fcdad5efb31.tar.xz manaplus-c25141f02a5b3dcddcc93ca5d2bd2fcdad5efb31.zip |
Add strong typed bool type Enable.
Diffstat (limited to 'src/statuseffect.cpp')
-rw-r--r-- | src/statuseffect.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/statuseffect.cpp b/src/statuseffect.cpp index d4083eac4..16936ec2b 100644 --- a/src/statuseffect.cpp +++ b/src/statuseffect.cpp @@ -115,9 +115,10 @@ int StatusEffect::blockEffectIndexToEffectIndex(const int blockIndex) } StatusEffect *StatusEffect::getStatusEffect(const int index, - const bool enabling) + const Enable enabling) { - std::map<int, StatusEffect *> &effects = statusEffects[enabling]; + std::map<int, StatusEffect *> &effects + = statusEffects[enabling == Enable_true]; const std::map<int, StatusEffect *>::iterator it = effects.find(index); if (it != effects.end()) return (*it).second; @@ -125,9 +126,11 @@ StatusEffect *StatusEffect::getStatusEffect(const int index, return nullptr; } -StatusEffect *StatusEffect::getStunEffect(const int index, const bool enabling) +StatusEffect *StatusEffect::getStunEffect(const int index, + const Enable enabling) { - std::map<int, StatusEffect *> &effects = stunEffects[enabling]; + std::map<int, StatusEffect *> &effects + = stunEffects[enabling == Enable_true]; const std::map<int, StatusEffect *>::iterator it = effects.find(index); if (it != effects.end()) return (*it).second; |