Resolve "Toggle Free Look with Hotkey"
[ryzomcore.git] / ryzom / server / src / ai_service / ai_logic_action.h
blob8439246b289c92ed9d85226220be17abaf43ba24
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/>.
19 #ifndef RYAI_LOGIC_ACTION_H
20 #define RYAI_LOGIC_ACTION_H
22 #include "alias_tree_owner.h"
23 #include "game_share/r2_basic_types.h"
25 class IAIEvent;
27 class CAIEventReaction;
28 class CGroupFamily;
29 class CGroup;
30 class CStateInstance;
32 //---------------------------------------------------------------------------------
33 // CAIEventReactionAction
34 //---------------------------------------------------------------------------------
35 // this is the base class for action types that can be used to process events for
36 // teams and other entiites
38 class IAILogicAction
39 : public NLMISC::CRefCount
41 public:
42 typedef NLMISC::CSmartPtr<IAILogicAction> TSmartPtr;
44 // NOTE: ctor takes following form:
45 // CLASS(const std::vector<std::string> &args, const std::vector<CAIEventReactionAction *> &subActions)
47 // note that actions are NOT responsible for deleting child actions
48 virtual ~IAILogicAction()
51 // this is the execute 'callback' for the action type.
52 // NOTE: This code should be fast and compact as it may be called very large numbers of times
53 // depending on the whim of the level designers
54 // returns true on success, false on failure
55 virtual bool executeAction (CStateInstance *entity,const IAIEvent *event)=0;
57 virtual void addPropertyZone (CTmpPropertyZone::TSmartPtr zone)
60 // attach a group family to the action if it supports it (assert otherwise)
61 virtual void addGroupFamily(CGroupFamily *gf) { nlassert(0); }
64 // Code use by native functions and LogicAction
65 class CAILogicActionDssStartActHelper
67 public:
68 static void dssStartAct(TSessionId sessionId, uint32 actId);
71 class CAILogicActionSitDownHelper
73 public:
74 static void sitDown(CGroup* group);
75 static void standUp(CGroup* group);
79 class CAILogicDynamicIfHelper
81 public:
82 static void setConditionSuccess(bool value) {_ConditionSuccess = value;}
83 static bool getConditionSuccess() { return _ConditionSuccess;}
84 private:
85 static bool _ConditionSuccess;
87 //---------------------------------------------------------------------------------
88 #endif