diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-04-21 05:25:01 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-04-21 05:25:01 +0300 |
commit | 8037d33c9f429d4c0322da383cdda46776c3c14e (patch) | |
tree | 7460a6dd0c774817ff1dd92aa190776ae1684ed9 /src/localplayer.h | |
parent | d7eae524bf7e88ebb5a324431b74a77ce1e7fded (diff) | |
download | plus-8037d33c9f429d4c0322da383cdda46776c3c14e.tar.gz plus-8037d33c9f429d4c0322da383cdda46776c3c14e.tar.bz2 plus-8037d33c9f429d4c0322da383cdda46776c3c14e.tar.xz plus-8037d33c9f429d4c0322da383cdda46776c3c14e.zip |
Impliment attack filter.
Add tab in social tab.
Diffstat (limited to 'src/localplayer.h')
-rw-r--r-- | src/localplayer.h | 47 |
1 files changed, 47 insertions, 0 deletions
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<std::string> getAttackMobs() + { return mAttackMobs; } + + void setAttackMobs(std::list<std::string> mobs) + { mAttackMobs = mobs; } + + int getAttackMobsSize() + { return mAttackMobs.size(); } + + std::list<std::string> getIgnoreAttackMobs() + { return mIgnoreAttackMobs; } + + std::set<std::string> getAttackMobsSet() + { return mAttackMobsSet; } + + std::set<std::string> getIgnoreAttackMobsSet() + { return mIgnoreAttackMobsSet; } + + void rebuildAttackMobs(); + + std::map<std::string, int> 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<std::string> mAttackMobs; + std::list<std::string> mIgnoreAttackMobs; + std::set<std::string> mAttackMobsSet; + std::set<std::string> mIgnoreAttackMobsSet; + std::map<std::string, int> mAttackMobsMap; }; extern LocalPlayer *player_node; |