diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-01-17 02:32:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-01-17 18:19:12 +0300 |
commit | 72277b0c8a16a5a2aabd634b127bcadd698430d5 (patch) | |
tree | 5b12463d9463f718f999b77fca0a17e3dc663f7f /src/playerrelations.cpp | |
parent | 2cefbbdce67c51e0728f46ef9086a565c0d187cc (diff) | |
download | manaplus-72277b0c8a16a5a2aabd634b127bcadd698430d5.tar.gz manaplus-72277b0c8a16a5a2aabd634b127bcadd698430d5.tar.bz2 manaplus-72277b0c8a16a5a2aabd634b127bcadd698430d5.tar.xz manaplus-72277b0c8a16a5a2aabd634b127bcadd698430d5.zip |
Add friends tab to social window.
Diffstat (limited to 'src/playerrelations.cpp')
-rw-r--r-- | src/playerrelations.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/playerrelations.cpp b/src/playerrelations.cpp index 28596ac8b..6b5cb0199 100644 --- a/src/playerrelations.cpp +++ b/src/playerrelations.cpp @@ -361,6 +361,24 @@ std::vector<std::string> * PlayerRelationsManager::getPlayers() return retval; } +std::vector<std::string> *PlayerRelationsManager::getPlayersByRelation( + PlayerRelation::Relation rel) +{ + std::vector<std::string> *retval = new std::vector<std::string>(); + + for (std::map<std::string, + PlayerRelation *>::const_iterator it = mRelations.begin(); + it != mRelations.end(); ++it) + { + if (it->second && it->second->mRelation == rel) + retval->push_back(it->first); + } + + sort(retval->begin(), retval->end(), playersSorter); + + return retval; +} + void PlayerRelationsManager::removePlayer(const std::string &name) { if (mRelations[name]) |