summaryrefslogtreecommitdiff
path: root/src/game-server/attributemanager.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2011-03-19 11:43:50 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2011-03-20 15:09:05 +0100
commit1f078e246ff03587e3ead220cac17bf343fb3328 (patch)
tree2a19358172162051954333ece5a86f344ee791de /src/game-server/attributemanager.cpp
parentfed17ee38e8050afba51cc57ef89e9b3e3ecbcb2 (diff)
downloadmanaserv-1f078e246ff03587e3ead220cac17bf343fb3328.tar.gz
manaserv-1f078e246ff03587e3ead220cac17bf343fb3328.tar.bz2
manaserv-1f078e246ff03587e3ead220cac17bf343fb3328.tar.xz
manaserv-1f078e246ff03587e3ead220cac17bf343fb3328.zip
Some renamings to try to make things more readable
AT_TY -> StackableType TY_ST -> Stackable TY_NST -> NonStackable TY_NSTB -> NonStackableBonus AME_TY -> ModifierEffectType AME_MULT -> Multiplicative AME_ADD -> Additive Got rid of related documentation, which is now stating the obvious. Also renamed many related variables. Reviewed-by: Freeyorp
Diffstat (limited to 'src/game-server/attributemanager.cpp')
-rw-r--r--src/game-server/attributemanager.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/game-server/attributemanager.cpp b/src/game-server/attributemanager.cpp
index 50cced31..8f7d32d1 100644
--- a/src/game-server/attributemanager.cpp
+++ b/src/game-server/attributemanager.cpp
@@ -78,54 +78,54 @@ void AttributeManager::reload()
{
if (xmlStrEqual(subnode->name, BAD_CAST "modifier"))
{
- std::string sType = utils::toUpper(
- XML::getProperty(subnode, "stacktype",
- std::string()));
- std::string eType = utils::toUpper(
- XML::getProperty(subnode, "modtype",
- std::string()));
+ std::string stackableTypeString = utils::toUpper(
+ XML::getProperty(subnode, "stacktype",
+ std::string()));
+ std::string effectTypeString = utils::toUpper(
+ XML::getProperty(subnode, "modtype",
+ std::string()));
std::string tag = utils::toUpper(
XML::getProperty(subnode, "tag",
std::string()));
- AT_TY pSType;
- AME_TY pEType;
- if (!sType.empty())
+ StackableType stackableType;
+ ModifierEffectType effectType;
+ if (!stackableTypeString.empty())
{
- if (!eType.empty())
+ if (!effectTypeString.empty())
{
bool fail = false;
- if (sType == "STACKABLE")
- pSType = TY_ST;
- else if (sType == "NON STACKABLE")
- pSType = TY_NST;
- else if (sType == "NON STACKABLE BONUS")
- pSType = TY_NSTB;
+ if (stackableTypeString == "STACKABLE")
+ stackableType = Stackable;
+ else if (stackableTypeString == "NON STACKABLE")
+ stackableType = NonStackable;
+ else if (stackableTypeString == "NON STACKABLE BONUS")
+ stackableType = NonStackableBonus;
else
{
LOG_WARN("Attribute manager: attribute '"
<< id << "' has unknown stack type '"
- << sType << "', skipping modifier!");
+ << stackableTypeString << "', skipping modifier!");
fail = true;
}
if (!fail)
{
- if (eType == "ADDITIVE")
- pEType = AME_ADD;
- else if (eType == "MULTIPLICATIVE")
- pEType = AME_MULT;
+ if (effectTypeString == "ADDITIVE")
+ effectType = Additive;
+ else if (effectTypeString == "MULTIPLICATIVE")
+ effectType = Multiplicative;
else
{
LOG_WARN(
"Attribute manager: attribute '" << id
<< "' has unknown modification type '"
- << sType << "', skipping modifier!");
+ << stackableTypeString << "', skipping modifier!");
fail = true;
}
if (!fail)
{
mAttributeMap[id].second.push_back(
- AttributeInfoType(pSType, pEType));
+ AttributeInfoType(stackableType, effectType));
std::string tag = XML::getProperty(
subnode, "tag", std::string());
@@ -184,9 +184,9 @@ void AttributeManager::reload()
}
LOG_DEBUG("attribute map:");
- LOG_DEBUG("TY_ST is " << TY_ST << ", TY_ NST is " << TY_NST
- << ", TY_NSTB is " << TY_NSTB << ".");
- LOG_DEBUG("AME_ADD is " << AME_ADD << ", AME_MULT is " << AME_MULT << ".");
+ LOG_DEBUG("Stackable is " << Stackable << ", NonStackable is " << NonStackable
+ << ", NonStackableBonus is " << NonStackableBonus << ".");
+ LOG_DEBUG("Additive is " << Additive << ", Multiplicative is " << Multiplicative << ".");
const std::string *tag;
unsigned int count = 0;
for (AttributeMap::const_iterator i = mAttributeMap.begin();
@@ -200,8 +200,8 @@ void AttributeManager::reload()
{
tag = getTagFromInfo(i->first, lCount);
std::string end = tag ? "tag of '" + (*tag) + "'." : "no tag.";
- LOG_DEBUG(" sType: " << j->sType << ", eType: " << j->eType << ", "
- "and " << end);
+ LOG_DEBUG(" stackableType: " << j->stackableType
+ << ", effectType: " << j->effectType << ", and " << end);
++lCount;
++count;
}