summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-21 17:14:02 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-21 17:14:02 +0300
commit49c798d504269545429d1aba72f7ee7a390b002f (patch)
tree3a8ebb96afe03ea8cdf2d536a119a53db491e47f
parent800b0f0477ac00a447aa958d1974e2c01d4eaa6c (diff)
downloadplus-49c798d504269545429d1aba72f7ee7a390b002f.tar.gz
plus-49c798d504269545429d1aba72f7ee7a390b002f.tar.bz2
plus-49c798d504269545429d1aba72f7ee7a390b002f.tar.xz
plus-49c798d504269545429d1aba72f7ee7a390b002f.zip
Rename some fields and methods in StatusEffectDB.
-rw-r--r--src/being/actorsprite.cpp2
-rw-r--r--src/resources/db/statuseffectdb.cpp18
-rw-r--r--src/resources/db/statuseffectdb.h2
3 files changed, 11 insertions, 11 deletions
diff --git a/src/being/actorsprite.cpp b/src/being/actorsprite.cpp
index 6c083b9ce..40b3ef992 100644
--- a/src/being/actorsprite.cpp
+++ b/src/being/actorsprite.cpp
@@ -195,7 +195,7 @@ void ActorSprite::setStatusEffectBlock(const int offset,
for (unsigned i = 0; i < STATUS_EFFECTS; i++)
{
const bool val = (newEffects & (1 << i)) > 0;
- const int index = StatusEffectDB::blockEffectIndexToEffectIndex(
+ const int index = StatusEffectDB::blockIdToId(
offset + i); // block-id (offset + i) to id (index)
if (index != -1)
diff --git a/src/resources/db/statuseffectdb.cpp b/src/resources/db/statuseffectdb.cpp
index 2c2dbeeff..a0e9695ce 100644
--- a/src/resources/db/statuseffectdb.cpp
+++ b/src/resources/db/statuseffectdb.cpp
@@ -42,17 +42,17 @@
namespace
{
- typedef std::map<int, StatusEffect *> status_effect_map[2];
+ typedef std::map<int, StatusEffect *> IdToEffectMap[2];
bool mLoaded = false;
- status_effect_map statusEffects;
- std::map<int, int> blockEffectIndexMap;
+ IdToEffectMap statusEffects;
+ std::map<int, int> blockIdToIdMap;
} // namespace
-int StatusEffectDB::blockEffectIndexToEffectIndex(const int blockIndex)
+int StatusEffectDB::blockIdToId(const int blockIndex)
{
- if (blockEffectIndexMap.find(blockIndex) == blockEffectIndexMap.end())
+ if (blockIdToIdMap.find(blockIndex) == blockIdToIdMap.end())
return -1;
- return blockEffectIndexMap[blockIndex];
+ return blockIdToIdMap[blockIndex];
}
StatusEffect *StatusEffectDB::getStatusEffect(const int index,
@@ -105,9 +105,9 @@ void StatusEffectDB::loadXmlFile(const std::string &fileName)
continue;
}
- status_effect_map *the_map = nullptr;
+ IdToEffectMap *the_map = nullptr;
- const int index = atoi(XML::getProperty(node, "id", "-1").c_str());
+ const int index = XML::getProperty(node, "id", -1);
if (xmlNameEqual(node, "status-effect"))
{
@@ -116,7 +116,7 @@ void StatusEffectDB::loadXmlFile(const std::string &fileName)
node, "block-id", "-1").c_str());
if (index >= 0 && block_index >= 0)
- blockEffectIndexMap[block_index] = index;
+ blockIdToIdMap[block_index] = index;
}
if (the_map)
diff --git a/src/resources/db/statuseffectdb.h b/src/resources/db/statuseffectdb.h
index d239c1903..6e39c9053 100644
--- a/src/resources/db/statuseffectdb.h
+++ b/src/resources/db/statuseffectdb.h
@@ -50,7 +50,7 @@ namespace StatusEffectDB
*
* Returns -1 on failure.
*/
- int blockEffectIndexToEffectIndex(const int blocKIndex) A_WARN_UNUSED;
+ int blockIdToId(const int blocKIndex) A_WARN_UNUSED;
void load();