diff options
Diffstat (limited to 'src/account-server/guild.cpp')
-rw-r--r-- | src/account-server/guild.cpp | 63 |
1 files changed, 23 insertions, 40 deletions
diff --git a/src/account-server/guild.cpp b/src/account-server/guild.cpp index 2e339ec1..cf864161 100644 --- a/src/account-server/guild.cpp +++ b/src/account-server/guild.cpp @@ -1,31 +1,23 @@ /* - * guild.cpp - * A file part of The Mana World + * The Mana World Server + * Copyright 2004 The Mana World Development Team * - * Created by David Athay on 01/03/2007. - * - * Copyright (c) 2007, The Mana World Development Team - * All rights reserved. + * This file is part of The Mana World. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * My name may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * The Mana World is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or any later version. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE + * The Mana World is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * $Id$ + * You should have received a copy of the GNU General Public License along + * with The Mana World; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id$ */ #include "guild.hpp" @@ -36,12 +28,10 @@ Guild::Guild(const std::string &name) : mName(name) { - } Guild::~Guild() { - } void Guild::addMember(CharacterData* player) @@ -54,17 +44,15 @@ void Guild::removeMember(CharacterData* player) mMembers.remove(player); } -bool Guild::checkLeader(CharacterData* player) +bool Guild::checkLeader(CharacterData *player) { - CharacterData* leader = mMembers.front(); - if(leader == player) - return true; - return false; + CharacterData *leader = mMembers.front(); + return leader == player; } bool Guild::checkInvited(const std::string &name) { - return (std::find(mInvited.begin(), mInvited.end(), name) != mInvited.end()); + return std::find(mInvited.begin(), mInvited.end(), name) != mInvited.end(); } void Guild::addInvited(const std::string &name) @@ -72,19 +60,14 @@ void Guild::addInvited(const std::string &name) mInvited.push_back(name); } -const std::string& Guild::getName() const -{ - return mName; -} - std::string Guild::getMember(int i) const { int x = 0; - for(guildMembers::const_iterator itr = mMembers.begin(); + for (guildMembers::const_iterator itr = mMembers.begin(); itr != mMembers.end(); ++itr, ++x) { - if(x == i) + if (x == i) { CharacterData *player = (*itr); return player->getName(); @@ -95,10 +78,10 @@ std::string Guild::getMember(int i) const bool Guild::checkInGuild(const std::string &name) { - for(guildMembers::iterator itr = mMembers.begin(); itr != mMembers.end(); ++itr) + for (guildMembers::iterator itr = mMembers.begin(); itr != mMembers.end(); ++itr) { CharacterData *player = (*itr); - if(player->getName() == name) + if (player->getName() == name) { return true; } |