summaryrefslogtreecommitdiff
path: root/src/statuseffect.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-06 18:37:06 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-06 18:37:06 +0300
commitc25141f02a5b3dcddcc93ca5d2bd2fcdad5efb31 (patch)
treeac124c630bc17ef10a8885a49fbb387f7091d15d /src/statuseffect.cpp
parent88697bc3503090194877b241b987ddc751034166 (diff)
downloadmanaverse-c25141f02a5b3dcddcc93ca5d2bd2fcdad5efb31.tar.gz
manaverse-c25141f02a5b3dcddcc93ca5d2bd2fcdad5efb31.tar.bz2
manaverse-c25141f02a5b3dcddcc93ca5d2bd2fcdad5efb31.tar.xz
manaverse-c25141f02a5b3dcddcc93ca5d2bd2fcdad5efb31.zip
Add strong typed bool type Enable.
Diffstat (limited to 'src/statuseffect.cpp')
-rw-r--r--src/statuseffect.cpp11
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;