summaryrefslogtreecommitdiff
path: root/src/playerrelations.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-01-17 02:32:13 +0300
committerAndrei Karas <akaras@inbox.ru>2012-01-17 18:19:12 +0300
commit72277b0c8a16a5a2aabd634b127bcadd698430d5 (patch)
tree5b12463d9463f718f999b77fca0a17e3dc663f7f /src/playerrelations.cpp
parent2cefbbdce67c51e0728f46ef9086a565c0d187cc (diff)
downloadmv-72277b0c8a16a5a2aabd634b127bcadd698430d5.tar.gz
mv-72277b0c8a16a5a2aabd634b127bcadd698430d5.tar.bz2
mv-72277b0c8a16a5a2aabd634b127bcadd698430d5.tar.xz
mv-72277b0c8a16a5a2aabd634b127bcadd698430d5.zip
Add friends tab to social window.
Diffstat (limited to 'src/playerrelations.cpp')
-rw-r--r--src/playerrelations.cpp18
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])