From 8037d33c9f429d4c0322da383cdda46776c3c14e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 21 Apr 2011 05:25:01 +0300 Subject: Impliment attack filter. Add tab in social tab. --- src/localplayer.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'src/localplayer.h') diff --git a/src/localplayer.h b/src/localplayer.h index f5e15e5f6..904ce74db 100644 --- a/src/localplayer.h +++ b/src/localplayer.h @@ -450,6 +450,48 @@ class LocalPlayer : public Being, public ActorSpriteListener, void checkNewName(Being *being); + bool isInAttackList(const std::string &name) + { return mAttackMobsSet.find(name) != mAttackMobsSet.end(); } + + bool isInIgnoreAttackList(const std::string &name) + { return mIgnoreAttackMobsSet.find(name) + != mIgnoreAttackMobsSet.end(); } + + bool isInAttackOrIgnoreList(const std::string &name) + { return mAttackMobsSet.find(name) != mAttackMobsSet.end() || + mIgnoreAttackMobsSet.find(name) != mIgnoreAttackMobsSet.end(); } + + void removeAttackMob(const std::string &name); + + void addAttackMob(std::string name); + + void addIgnoreAttackMob(std::string name); + + std::list getAttackMobs() + { return mAttackMobs; } + + void setAttackMobs(std::list mobs) + { mAttackMobs = mobs; } + + int getAttackMobsSize() + { return mAttackMobs.size(); } + + std::list getIgnoreAttackMobs() + { return mIgnoreAttackMobs; } + + std::set getAttackMobsSet() + { return mAttackMobsSet; } + + std::set getIgnoreAttackMobsSet() + { return mIgnoreAttackMobsSet; } + + void rebuildAttackMobs(); + + std::map getAttackMobsMap() + { return mAttackMobsMap; } + + int getAttackMobIndex(std::string name); + protected: /** Whether or not the name settings have changed */ bool mUpdateName; @@ -576,6 +618,11 @@ class LocalPlayer : public Being, public ActorSpriteListener, bool mServerAttack; std::string mLastHitFrom; std::string mWaitFor; + std::list mAttackMobs; + std::list mIgnoreAttackMobs; + std::set mAttackMobsSet; + std::set mIgnoreAttackMobsSet; + std::map mAttackMobsMap; }; extern LocalPlayer *player_node; -- cgit v1.2.3-60-g2f50