Resolve "Toggle Free Look with Hotkey"
[ryzomcore.git] / ryzom / server / src / ai_service / state_chat.h
blob2266b35460d0993a4d2a96dfa5534f115a3b229e
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef RYAI_STATE_CHAT_H
21 #define RYAI_STATE_CHAT_H
23 #include "child_container.h"
24 #include "ai_keywords.h"
25 #include "npc_description_msg.h"
27 class CAIState;
28 class CBotNpc;
30 class CAIStateChat
31 :public CAliasChild<CAIState>
32 ,public NLMISC::CRefCount
34 public:
35 // ctor & dtor ------------------------------------------------------
36 CAIStateChat(CAIState* state, CAIAliasDescriptionNode *aliasDescription): CAliasChild<CAIState>(state,aliasDescription)
38 virtual ~CAIStateChat()
41 virtual std::string getIndexString () const;
43 // Keyword management ----------------------------------------------
44 void botKeywordFilterClear() { _botKeywordFilter.clear(); }
45 void botKeywordFilterAdd(const std::string &keyword);
47 bool botKeywordTest(CKeywordMask mask) { return _botKeywordFilter.test(mask); }
49 // name management -------------------------------------------------
50 void botNameFilterClear() { _namedBots.clear(); }
51 void botNameFilterAdd(const std::string &name) { _namedBots.push_back(name); }
53 bool botNameTest(const std::string &name) const
55 std::vector<std::string>::const_iterator it(std::find(_namedBots.begin(), _namedBots.end(), name));
56 return it != _namedBots.end();
59 // compatibility test ----------------------------------------------
60 bool testCompatibility(const CBotNpc &bot) const;
62 // Chat management
63 const CNpcChatProfileImp &getChat() const
65 return _chatProfile;
67 CNpcChatProfileImp &chatProfile ()
69 return _chatProfile;
72 private:
73 // protected data ---------------------------------------------------
74 CKeywordFilter _botKeywordFilter; // keyword filter for identifying bot types to whom to apply profile
75 std::vector<std::string> _namedBots; // list of named bots to whom this profile applies
77 CNpcChatProfileImp _chatProfile; // the chat profile buffer
80 #endif