00001
00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024
00025
00026 #ifndef NL_ACTOR_H_
00027 #define NL_ACTOR_H_
00028
00029 #include "nel/ai/agent/agent.h"
00030 #include "nel/ai/agent/agent_script.h"
00031 #include "nel/ai/logic/bool_cond.h"
00032 #include "nel/ai/script/type_def.h"
00033
00034 namespace NLAIAGENT
00035 {
00036 class CActor;
00037
00046 class CActor : public IAgent
00047 {
00048 protected:
00049
00050 enum c_funcs_id
00051 {
00052 fid_activate,
00053 fid_unActivate,
00054 fid_forwardActivity
00055 };
00056
00057 bool _IsActivated;
00058
00059
00063 virtual void forwardActivity(CActor *, bool stay_active = false);
00067 virtual void forwardActivity(std::vector<CActor *> &, bool stay_active = false);
00068
00069
00070 public:
00072 CActor();
00073
00074 CActor(IAgent *, bool activated = false);
00075
00076 CActor(const CActor &);
00077 ~CActor();
00078
00080 bool isActivated();
00082 void addTransition(NLAILOGIC::IBaseCond *, std::vector<CActor *> &, bool);
00083
00084
00086 void activate();
00088 virtual void onActivate();
00089
00091 void unActivate();
00093 virtual void onUnActivate();
00094
00096
00097 virtual const NLAIC::IBasicType *clone() const;
00098 virtual const NLAIC::IBasicType *newInstance() const;
00099 virtual void getDebugString(char *t) const;
00100 virtual bool isEqual(const IBasicObjectIA &a) const;
00101 virtual void processMessages();
00102 virtual const CProcessResult &run();
00103 virtual const NLAIC::CIdentType &getType() const;
00104
00105 static const NLAIC::CIdentType IdActor;
00106
00107 virtual void save(NLMISC::IStream &os);
00108 virtual void load(NLMISC::IStream &is);
00109
00110 virtual tQueue isMember(const NLAIAGENT::IVarName *, const NLAIAGENT::IVarName *, const IObjectIA &) const;
00111 virtual IObjectIA::CProcessResult runMethodeMember(sint32, IObjectIA *);
00112 virtual sint32 getMethodIndexSize() const;
00114 };
00115 }
00116 #endif