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_PROFILE_H
21 #define RYAI_STATE_PROFILE_H
23 #include "child_container.h"
24 #include "ai_keywords.h"
25 #include "npc_description_msg.h"
26 #include "profile_in_state.h"
31 class CAIStateProfile
:
32 public CAliasChild
<CAIState
>,
33 public NLMISC::CRefCount
,
34 public CProfileInState
37 typedef std::pair
<std::string
, std::string
> TProfileParameter
;
39 // ctor & dtor ------------------------------------------------------
40 CAIStateProfile(CAIState
* state
, CAIAliasDescriptionNode
*aliasDescription
): CAliasChild
<CAIState
>(state
,aliasDescription
)
42 virtual ~CAIStateProfile()
45 virtual std::string
getIndexString () const;
47 // Keyword management ----------------------------------------------
48 void grpKeywordFilterClear() { _grpKeywordFilter
.clear(); }
49 void grpKeywordFilterAdd(const std::string
&keyword
);
51 bool grpKeywordTest(CKeywordMask mask
) { return _grpKeywordFilter
.test(mask
); }
53 // name management -------------------------------------------------
54 void grpNameFilterClear() { _namedGrps
.clear(); }
55 void grpNameFilterAdd(const std::string
&name
) { _namedGrps
.push_back(name
); }
57 bool grpNameTest(const std::string
&name
) const
59 std::vector
<std::string
>::const_iterator
it(std::find(_namedGrps
.begin(), _namedGrps
.end(), name
));
60 return it
!= _namedGrps
.end();
63 // compatibility test ----------------------------------------------
64 bool testCompatibility(const CGroupNpc
&bot
) const;
67 // protected data ---------------------------------------------------
68 CKeywordFilter _grpKeywordFilter
; // keyword filter for identifying grp types for bots to whom to apply profile
69 std::vector
<std::string
> _namedGrps
; // list of named grps to whom this profile applies