# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

actor.h

Go to the documentation of this file.
00001 
00007 /* Copyright, 2000 Nevrax Ltd.
00008  *
00009  * This file is part of NEVRAX NEL.
00010  * NEVRAX NEL is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2, or (at your option)
00013  * any later version.
00014 
00015  * NEVRAX NEL is distributed in the hope that it will be useful, but
00016  * WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00018  * General Public License for more details. 
00019 
00020  * You should have received a copy of the GNU General Public License
00021  * along with NEVRAX NEL; see the file COPYING. If not, write to the
00022  * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00023  * MA 02111-1307, USA.
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 //                      std::vector<CTransition *> _Transitions;
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                         // Builds and actor with its father
00074                         CActor(IAgent *, bool activated = false);
00075                         // copy constructor
00076                         CActor(const CActor &);
00077                         ~CActor();
00078 
00080                         bool isActivated();
00082                         void addTransition(NLAILOGIC::IBaseCond *, std::vector<CActor *> &, bool);
00083 //                      void addTransition(CTransition *);
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(std::string &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