summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-01-19 15:25:24 +0300
committerAndrei Karas <akaras@inbox.ru>2013-01-20 17:05:57 +0300
commit48071e171de41a23197c7328ba038331a936e0eb (patch)
tree73c7ef1da8e5dd76469d75c0336d88c3371e4263 /src/being.cpp
parentd07fba228b5251862ad670e1d4f079c9456fab4b (diff)
downloadmanaplus-48071e171de41a23197c7328ba038331a936e0eb.tar.gz
manaplus-48071e171de41a23197c7328ba038331a936e0eb.tar.bz2
manaplus-48071e171de41a23197c7328ba038331a936e0eb.tar.xz
manaplus-48071e171de41a23197c7328ba038331a936e0eb.zip
Replace for to FOR_EACH in some classes.
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 910feb936..633be5d53 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -190,7 +190,8 @@ bool Being::mEnableReorderSprites = true;
bool Being::mHideErased = false;
std::list<BeingCacheEntry*> beingInfoCache;
-
+typedef std::map<int, Guild*>::const_iterator GuildsMapCIter;
+typedef std::map<int, int>::const_iterator IntMapCIter;
// TODO: mWalkTime used by eAthena only
Being::Being(const int id, const Type type, const uint16_t subtype,
@@ -908,8 +909,7 @@ void Being::removeGuild(const int id)
Guild *Being::getGuild(const std::string &guildName) const
{
- for (std::map<int, Guild*>::const_iterator itr = mGuilds.begin(),
- itr_end = mGuilds.end(); itr != itr_end; ++itr)
+ FOR_EACH (GuildsMapCIter, itr, mGuilds)
{
Guild *const guild = itr->second;
if (guild && guild->getName() == guildName)
@@ -939,8 +939,7 @@ Guild *Being::getGuild() const
void Being::clearGuilds()
{
- for (std::map<int, Guild*>::const_iterator itr = mGuilds.begin(),
- itr_end = mGuilds.end(); itr != itr_end; ++itr)
+ FOR_EACH (GuildsMapCIter, itr, mGuilds)
{
Guild *const guild = itr->second;
@@ -2034,8 +2033,7 @@ void Being::addToCache() const
BeingCacheEntry* Being::getCacheEntry(const int id)
{
- for (std::list<BeingCacheEntry*>::iterator i = beingInfoCache.begin();
- i != beingInfoCache.end(); ++ i)
+ FOR_EACH (std::list<BeingCacheEntry*>::iterator, i, beingInfoCache)
{
if (!*i)
continue;
@@ -2346,8 +2344,7 @@ void Being::recalcSpritesOrder()
if (spriteToItems)
{
- for (SpriteToItemMapCIter itr = spriteToItems->begin(),
- itr_end = spriteToItems->end(); itr != itr_end; ++ itr)
+ FOR_EACHP (SpriteToItemMapCIter, itr, spriteToItems)
{
const int remSprite = itr->first;
const std::map<int, int> &itemReplacer = itr->second;
@@ -2392,10 +2389,7 @@ void Being::recalcSpritesOrder()
}
else
{ // slot unknown. Search for real slot, this can be slow
- for (std::map<int, int>::const_iterator
- repIt = itemReplacer.begin(),
- repIt_end = itemReplacer.end();
- repIt != repIt_end; ++ repIt)
+ FOR_EACH (IntMapCIter, repIt, itemReplacer)
{
for (unsigned slot2 = 0; slot2 < sz; slot2 ++)
{