diff options
author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2013-04-13 23:14:39 +0200 |
---|---|---|
committer | Erik Schilling <ablu.erikschilling@googlemail.com> | 2013-05-08 14:02:50 +0200 |
commit | fe26d911ca35fb6d4f886567d3c0e8f03120f4ef (patch) | |
tree | 06a239f74c1a00124e5e91646b7d1d5dd797f427 /src/game-server/abilitymanager.cpp | |
parent | 708896008ad8ea391d542ce37b9871318a84fb97 (diff) | |
download | manaserv-fe26d911ca35fb6d4f886567d3c0e8f03120f4ef.tar.gz manaserv-fe26d911ca35fb6d4f886567d3c0e8f03120f4ef.tar.xz manaserv-fe26d911ca35fb6d4f886567d3c0e8f03120f4ef.zip |
[Abilities] Renamed set to category
On the one hand setSetName and setName could sound misleading in the qt
client patch i plan. On the otherhand i never really liked the name
"set". I think category is more general and obvious.
Diffstat (limited to 'src/game-server/abilitymanager.cpp')
-rw-r--r-- | src/game-server/abilitymanager.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/game-server/abilitymanager.cpp b/src/game-server/abilitymanager.cpp index 91669f1..eb89829 100644 --- a/src/game-server/abilitymanager.cpp +++ b/src/game-server/abilitymanager.cpp @@ -41,26 +41,25 @@ static AbilityManager::TargetMode getTargetByString(const std::string &str) * Read a <special> element from settings. * Used by SettingsManager. */ -void AbilityManager::readAbilitySetNode(xmlNodePtr node, - const std::string &filename) +void AbilityManager::readAbilityCategoryNode(xmlNodePtr node, + const std::string &filename) { - std::string setName = XML::getProperty(node, "name", std::string()); - if (setName.empty()) + std::string categoryName = XML::getProperty(node, "name", std::string()); + if (categoryName.empty()) { LOG_WARN("The " << filename << " file contains unamed " - << "<ability-set> tags and will be ignored."); + << "<ability-category> tags and will be ignored."); return; } - setName = utils::toLower(setName); + categoryName = utils::toLower(categoryName); for_each_xml_child_node(specialNode, node) { if (xmlStrEqual(specialNode->name, BAD_CAST "ability")) { - readAbilityNode(specialNode, setName); + readAbilityNode(specialNode, categoryName); } } - } /** @@ -73,7 +72,7 @@ void AbilityManager::checkStatus() void AbilityManager::readAbilityNode(xmlNodePtr abilityNode, - const std::string &setName) + const std::string &categoryName) { std::string name = utils::toLower( XML::getProperty(abilityNode, "name", std::string())); @@ -81,7 +80,8 @@ void AbilityManager::readAbilityNode(xmlNodePtr abilityNode, if (id <= 0 || name.empty()) { - LOG_WARN("Invalid ability (empty name or id <= 0) in set: " << setName); + LOG_WARN("Invalid ability (empty name or id <= 0) in category: " + << categoryName); return; } @@ -104,14 +104,14 @@ void AbilityManager::readAbilityNode(xmlNodePtr abilityNode, if (rechargeable && neededMana <= 0) { LOG_WARN("Invalid ability '" << name - << "' (rechargable but no needed attribute) in set: " - << setName); + << "' (rechargable but no needed attribute) in category: " + << categoryName); return; } AbilityInfo *newInfo = new AbilityManager::AbilityInfo; - newInfo->setName = setName; + newInfo->categoryName = categoryName; newInfo->name = name; newInfo->id = id; newInfo->rechargeable = rechargeable; @@ -123,7 +123,7 @@ void AbilityManager::readAbilityNode(xmlNodePtr abilityNode, mAbilitiesInfo[newInfo->id] = newInfo; - std::string keyName = setName + "_" + newInfo->name; + std::string keyName = categoryName + "_" + newInfo->name; mNamedAbilitiesInfo[keyName] = newInfo; } @@ -148,10 +148,10 @@ void AbilityManager::clear() mNamedAbilitiesInfo.clear(); } -unsigned AbilityManager::getId(const std::string &set, +unsigned AbilityManager::getId(const std::string &category, const std::string &name) const { - std::string key = utils::toLower(set) + "_" + utils::toLower(name); + std::string key = utils::toLower(category) + "_" + utils::toLower(name); return getId(key); } @@ -169,10 +169,10 @@ const std::string AbilityManager::getAbilityName(int id) const return it != mAbilitiesInfo.end() ? it->second->name : ""; } -const std::string AbilityManager::getSetName(int id) const +const std::string AbilityManager::getCategoryName(int id) const { AbilitiesInfo::const_iterator it = mAbilitiesInfo.find(id); - return it != mAbilitiesInfo.end() ? it->second->setName : ""; + return it != mAbilitiesInfo.end() ? it->second->categoryName : ""; } AbilityManager::AbilityInfo *AbilityManager::getAbilityInfo(int id) |