summaryrefslogtreecommitdiff
path: root/src/party.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-03-31 21:33:31 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-03-31 22:17:29 +0200
commit7e13e0f2cacc1e0e4177b73eaf71a430094cc58f (patch)
treed540584082be4a8eb494a59e018a5fe8e79d0943 /src/party.cpp
parent9a0f5327c25c57963af837439d23a61c9510a6ac (diff)
downloadmana-7e13e0f2cacc1e0e4177b73eaf71a430094cc58f.tar.gz
mana-7e13e0f2cacc1e0e4177b73eaf71a430094cc58f.tar.bz2
mana-7e13e0f2cacc1e0e4177b73eaf71a430094cc58f.tar.xz
mana-7e13e0f2cacc1e0e4177b73eaf71a430094cc58f.zip
Removed some unused members from Party and Guild classes
Reviewed-by: Jared Adams
Diffstat (limited to 'src/party.cpp')
-rw-r--r--src/party.cpp56
1 files changed, 8 insertions, 48 deletions
diff --git a/src/party.cpp b/src/party.cpp
index 22740489..75283916 100644
--- a/src/party.cpp
+++ b/src/party.cpp
@@ -28,16 +28,6 @@ PartyMember::PartyMember(Party *party, int id, const std::string &name):
{
}
-PartyMember::PartyMember(Party *party, int id):
- mId(id), mParty(party), mLeader(false)
-{
-}
-
-PartyMember::PartyMember(Party *party, const std::string &name):
- Avatar(name), mParty(party), mLeader(false)
-{
-}
-
Party::PartyMap Party::parties;
Party::Party(short id):
@@ -67,43 +57,13 @@ PartyMember *Party::addMember(int id, const std::string &name)
return m;
}
-PartyMember *Party::addMember(int id)
-{
- PartyMember *m;
- if ((m = getMember(id)))
- {
- return m;
- }
-
- m = new PartyMember(this, id);
-
- mMembers.push_back(m);
-
- return m;
-}
-
-PartyMember *Party::addMember(const std::string &name)
+PartyMember *Party::getMember(int id) const
{
- PartyMember *m;
- if ((m = getMember(name)))
- {
- return m;
- }
-
- m = new PartyMember(this, name);
-
- mMembers.push_back(m);
-
- return m;
-}
-
-PartyMember *Party::getMember(int id)
-{
- MemberList::iterator itr = mMembers.begin(),
+ MemberList::const_iterator itr = mMembers.begin(),
itr_end = mMembers.end();
- while(itr != itr_end)
+ while (itr != itr_end)
{
- if((*itr)->mId == id)
+ if ((*itr)->mId == id)
{
return (*itr);
}
@@ -113,13 +73,13 @@ PartyMember *Party::getMember(int id)
return NULL;
}
-PartyMember *Party::getMember(std::string name)
+PartyMember *Party::getMember(const std::string &name) const
{
- MemberList::iterator itr = mMembers.begin(),
+ MemberList::const_iterator itr = mMembers.begin(),
itr_end = mMembers.end();
- while(itr != itr_end)
+ while (itr != itr_end)
{
- if((*itr)->getName() == name)
+ if ((*itr)->getName() == name)
{
return (*itr);
}