1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
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.
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"
31 :public CAliasChild
<CAIState
>
32 ,public NLMISC::CRefCount
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;
63 const CNpcChatProfileImp
&getChat() const
67 CNpcChatProfileImp
&chatProfile ()
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