diff options
Diffstat (limited to 'src/guild.cpp')
-rw-r--r-- | src/guild.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/guild.cpp b/src/guild.cpp index b8b277e5..8e89a133 100644 --- a/src/guild.cpp +++ b/src/guild.cpp @@ -21,6 +21,9 @@ #include "guild.h" +#include "beingmanager.h" +#include "player.h" + GuildMember::GuildMember(int guildId, int id, const std::string &name): Avatar(name), mId(id) { @@ -131,6 +134,21 @@ void Guild::removeMember(const std::string &name) } } +void Guild::removeFromMembers() +{ + MemberList::iterator itr = mMembers.begin(), + itr_end = mMembers.end(); + while(itr != itr_end) + { + Player *p = dynamic_cast<Player*>(beingManager->findBeing((*itr)->getID())); + if (p) + { + p->removeGuild(getId()); + } + ++itr; + } +} + Avatar *Guild::getAvatarAt(int index) { return mMembers[index]; |