summaryrefslogtreecommitdiff
path: root/src/guild.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2010-01-10 17:19:24 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-01-10 17:20:33 +0100
commitf5a394a5051384a930d635da22ccafc6beb1cb84 (patch)
treed28fc14408a6bb91170e05880b4d2af6a17fcc14 /src/guild.cpp
parent5757066312cab082378dbc5d8df97dea3fe40af0 (diff)
downloadmana-f5a394a5051384a930d635da22ccafc6beb1cb84.tar.gz
mana-f5a394a5051384a930d635da22ccafc6beb1cb84.tar.bz2
mana-f5a394a5051384a930d635da22ccafc6beb1cb84.tar.xz
mana-f5a394a5051384a930d635da22ccafc6beb1cb84.zip
Change code style
Diffstat (limited to 'src/guild.cpp')
-rw-r--r--src/guild.cpp38
1 files changed, 10 insertions, 28 deletions
diff --git a/src/guild.cpp b/src/guild.cpp
index c06f2176..f44ecccf 100644
--- a/src/guild.cpp
+++ b/src/guild.cpp
@@ -51,9 +51,7 @@ Guild::Guild(short id):
void Guild::addMember(GuildMember *member)
{
if (member->mGuild > 0 && member->mGuild != this)
- {
throw "Member in another guild!";
- }
if (!isMember(member))
{
@@ -66,12 +64,10 @@ GuildMember *Guild::getMember(int id)
{
MemberList::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);
- }
++itr;
}
@@ -82,9 +78,9 @@ GuildMember *Guild::getMember(std::string name)
{
MemberList::iterator itr = mMembers.begin(),
itr_end = mMembers.end();
- while(itr != itr_end)
+ while (itr != itr_end)
{
- if((*itr)->mName == name)
+ if ((*itr)->mName == name)
{
return (*itr);
}
@@ -98,9 +94,9 @@ void Guild::removeMember(GuildMember *member)
{
MemberList::iterator itr = mMembers.begin(),
itr_end = mMembers.end();
- while(itr != itr_end)
+ while (itr != itr_end)
{
- if((*itr)->mId == member->mId && (*itr)->mName == member->mName)
+ if ((*itr)->mId == member->mId && (*itr)->mName == member->mName)
{
mMembers.erase(itr);
}
@@ -112,12 +108,10 @@ void Guild::removeMember(int id)
{
MemberList::iterator itr = mMembers.begin(),
itr_end = mMembers.end();
- while(itr != itr_end)
+ while (itr != itr_end)
{
- if((*itr)->mId == id)
- {
+ if ((*itr)->mId == id)
mMembers.erase(itr);
- }
++itr;
}
}
@@ -126,9 +120,9 @@ void Guild::removeMember(const std::string &name)
{
MemberList::iterator itr = mMembers.begin(),
itr_end = mMembers.end();
- while(itr != itr_end)
+ while (itr != itr_end)
{
- if((*itr)->mName == name)
+ if ((*itr)->mName == name)
{
mMembers.erase(itr);
}
@@ -140,22 +134,16 @@ std::string Guild::getElementAt(int index)
{
GuildMember *m = mMembers[index];
if (m->mOnline)
- {
return "* " + m->mName;
- }
else
- {
return m->mName;
- }
}
void Guild::setRights(short rights)
{
// to invite, rights must be greater than 0
if (rights > 0)
- {
mCanInviteUsers = true;
- }
}
bool Guild::isMember(GuildMember *member) const
@@ -168,9 +156,7 @@ bool Guild::isMember(GuildMember *member) const
while (itr != itr_end)
{
if ((*itr)->mId == member->mId && (*itr)->mName == member->mName)
- {
return true;
- }
++itr;
}
@@ -184,9 +170,7 @@ bool Guild::isMember(int id) const
while (itr != itr_end)
{
if ((*itr)->mId == id)
- {
return true;
- }
++itr;
}
@@ -200,9 +184,7 @@ bool Guild::isMember(const std::string &name) const
while (itr != itr_end)
{
if ((*itr)->mName == name)
- {
return true;
- }
++itr;
}