diff options
author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2012-08-07 12:21:24 +0200 |
---|---|---|
committer | Erik Schilling <ablu.erikschilling@googlemail.com> | 2012-08-12 23:33:25 +0200 |
commit | 9f564cc42ba650c502a31b72dc59530fcad684cd (patch) | |
tree | 01b355a0c915f47cea8821463b6c313fa0bec7ef /src/gui/specialswindow.cpp | |
parent | 23db322600556230f59f53a99050491f623308a2 (diff) | |
download | mana-9f564cc42ba650c502a31b72dc59530fcad684cd.tar.gz mana-9f564cc42ba650c502a31b72dc59530fcad684cd.tar.bz2 mana-9f564cc42ba650c502a31b72dc59530fcad684cd.tar.xz mana-9f564cc42ba650c502a31b72dc59530fcad684cd.zip |
Fixed coding style in specialswindow
Reviewed-by: Thorbjørn Lindeijer.
Diffstat (limited to 'src/gui/specialswindow.cpp')
-rw-r--r-- | src/gui/specialswindow.cpp | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/src/gui/specialswindow.cpp b/src/gui/specialswindow.cpp index 3caeded3..ac1f460b 100644 --- a/src/gui/specialswindow.cpp +++ b/src/gui/specialswindow.cpp @@ -127,19 +127,20 @@ void SpecialsWindow::draw(gcn::Graphics *graphics) bool foundNew = false; unsigned int found = 0; // number of entries in specialData which match mEntries - for (std::map<int, Special>::iterator i = specialData.begin(); - i != specialData.end(); - i++) + for (std::map<int, Special>::iterator it = specialData.begin(); + it != specialData.end(); ++it) { - std::map<int, SpecialEntry *>::iterator e = mEntries.find(i->first); + std::map<int, SpecialEntry *>::iterator e = mEntries.find(it->first); if (e == mEntries.end()) { // found a new special - abort update and rebuild from scratch foundNew = true; break; - } else { + } + else + { // update progress bar of special - e->second->update(i->second.currentMana, i->second.neededMana); + e->second->update(it->second.currentMana, it->second.neededMana); found++; } } @@ -157,24 +158,25 @@ void SpecialsWindow::rebuild(const std::map<int, Special> &specialData) mEntries.clear(); int vPos = 0; //vertical position of next placed element - for (std::map<int, Special>::const_iterator i = specialData.begin(); - i != specialData.end(); - i++) + for (std::map<int, Special>::const_iterator it = specialData.begin(); + it != specialData.end(); ++it) { - logger->log("Updating special GUI for %d", i->first); + logger->log("Updating special GUI for %d", it->first); - SpecialInfo* info = SpecialDB::get(i->first); + SpecialInfo *info = SpecialDB::get(it->first); if (info) { - info->rechargeCurrent = i->second.currentMana; - info->rechargeNeeded = i->second.neededMana; + info->rechargeCurrent = it->second.currentMana; + info->rechargeNeeded = it->second.neededMana; SpecialEntry* entry = new SpecialEntry(info); entry->setPosition(0, vPos); vPos += entry->getHeight() + 3; add(entry); - mEntries[i->first] = entry; - } else { - logger->log("Warning: No info available of special %d", i->first); + mEntries[it->first] = entry; + } + else + { + logger->log("Warning: No info available of special %d", it->first); } } } |