summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp62
1 files changed, 6 insertions, 56 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index f581db27..1614b7e7 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -26,6 +26,7 @@
#include "equipment.h"
#include "floor_item.h"
#include "game.h"
+#include "guild.h"
#include "inventory.h"
#include "item.h"
#include "main.h"
@@ -116,65 +117,14 @@ void LocalPlayer::nextStep()
Player::nextStep();
}
-void LocalPlayer::addGuild(short guildId, bool inviteRights)
-{
- Guild *guild = new Guild(guildId, inviteRights);
- mGuilds.push_back(guild);
-}
-
-void LocalPlayer::removeGuild(short guildId)
-{
- std::vector<Guild*>::iterator itr;
- for (itr = mGuilds.begin(); itr != mGuilds.end(); ++itr)
- {
- Guild *guild = (*itr);
- if (guild->getId() == guildId)
- {
- delete guild;
- mGuilds.erase(itr);
- return;
- }
- }
-}
-
-Guild* LocalPlayer::findGuildById(short guildId)
-{
- for (unsigned int i = 0; i < mGuilds.size(); ++i)
- {
- if (mGuilds[i]->getId() == guildId)
- {
- return mGuilds[i];
- }
- }
-
- // not found return NULL
- return NULL;
-}
-
-Guild* LocalPlayer::findGuildByName(const std::string &guildName)
+bool LocalPlayer::checkInviteRights(const std::string &guildName)
{
- for (unsigned int i = 0; i < mGuilds.size(); ++i)
+ Guild *guild = getGuild(guildName);
+ if (guild)
{
- if(mGuilds[i]->getName() == guildName)
- {
- return mGuilds[i];
- }
+ return guild->getInviteRights();
}
-
- // Not found, so return NULL
- return NULL;
-}
-short LocalPlayer::getNumberOfGuilds()
-{
- return mGuilds.size();
-}
-
-bool LocalPlayer::checkInviteRights(const std::string &guildName)
-{
- Guild *guild = findGuildByName(guildName);
- if(guild)
- return guild->getInviteRights();
return false;
}
@@ -446,7 +396,7 @@ void LocalPlayer::lowerAttribute(size_t attr)
const std::string& LocalPlayer::getSkillName(int skill)
{
static const std::string skills[CHAR_SKILL_NB + 1] =
- {
+ {
_("Unarmed"), // CHAR_SKILL_WEAPON_NONE
_("Knife"), // CHAR_SKILL_WEAPON_KNIFE
_("Sword"), // CHAR_SKILL_WEAPON_SWORD