From 3b4e7795c9ab3036988a1a7dfe6f5ed2ad12199d Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Mon, 17 May 2010 19:16:11 -0600 Subject: Remove Monster, Player, and NPC classes Instead of having these three subclasses with minor differences, this commit merges them back into Being. In the future, we can make Beings that are talkable to some, attackable by others, etc. This also puts back support for monster equipment. Also changes remaining references to Being::Type and the constants to refer to ActorSprite::Type. Reviewed-by: Freeyorp --- src/playerrelations.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/playerrelations.cpp') diff --git a/src/playerrelations.cpp b/src/playerrelations.cpp index bd657f4f..e8c015d1 100644 --- a/src/playerrelations.cpp +++ b/src/playerrelations.cpp @@ -25,7 +25,6 @@ #include "beingmanager.h" #include "configuration.h" #include "graphics.h" -#include "player.h" #include "playerrelations.h" #include "utils/dtor.h" @@ -205,7 +204,7 @@ unsigned int PlayerRelationsManager::checkPermissionSilently(const std::string & bool PlayerRelationsManager::hasPermission(Being *being, unsigned int flags) { - if (being->getType() == Being::PLAYER) + if (being->getType() == ActorSprite::PLAYER) return hasPermission(being->getName(), flags) == flags; return true; } @@ -221,9 +220,10 @@ bool PlayerRelationsManager::hasPermission(const std::string &name, // execute `ignore' strategy, if possible if (mIgnoreStrategy) { - Being *b = beingManager->findBeingByName(name, Being::PLAYER); - if (b && b->getType() == Being::PLAYER) - mIgnoreStrategy->ignore(static_cast(b), rejections); + Being *b = beingManager->findBeingByName(name, + ActorSprite::PLAYER); + if (b && b->getType() == ActorSprite::PLAYER) + mIgnoreStrategy->ignore(b, rejections); } } @@ -304,7 +304,7 @@ public: mShortName = PLAYER_IGNORE_STRATEGY_NOP; } - virtual void ignore(Player *player, unsigned int flags) + virtual void ignore(Being *being, unsigned int flags) { } }; @@ -318,9 +318,9 @@ public: mShortName = "dotdotdot"; } - virtual void ignore(Player *player, unsigned int flags) + virtual void ignore(Being *being, unsigned int flags) { - player->setSpeech("...", 500); + being->setSpeech("...", 500); } }; @@ -334,9 +334,9 @@ public: mShortName = "blinkname"; } - virtual void ignore(Player *player, unsigned int flags) + virtual void ignore(Being *being, unsigned int flags) { - player->flashName(200); + being->flashName(200); } }; @@ -350,9 +350,9 @@ public: mShortName = shortname; } - virtual void ignore(Player *player, unsigned int flags) + virtual void ignore(Being *being, unsigned int flags) { - player->setEmote(mEmotion, IGNORE_EMOTE_TIME); + being->setEmote(mEmotion, IGNORE_EMOTE_TIME); } private: int mEmotion; -- cgit v1.2.3-70-g09d2