From 49c798d504269545429d1aba72f7ee7a390b002f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 21 Mar 2016 17:14:02 +0300 Subject: Rename some fields and methods in StatusEffectDB. --- src/resources/db/statuseffectdb.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/resources/db/statuseffectdb.cpp') 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 status_effect_map[2]; + typedef std::map IdToEffectMap[2]; bool mLoaded = false; - status_effect_map statusEffects; - std::map blockEffectIndexMap; + IdToEffectMap statusEffects; + std::map 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) -- cgit v1.2.3-60-g2f50