# 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  

interpret_fsm.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_FSM_CLASS
00027 #define NL_FSM_CLASS
00028 
00029 #include "nel/ai/script/interpret_actor.h"
00030 #include "nel/ai/logic/goal.h"
00031 #include "nel/ai/logic/fact.h"
00032 #include "nel/ai/logic/var.h"
00033 #include "nel/ai/logic/operator_script.h"
00034 
00035 namespace NLAISCRIPT
00036 {
00037         class CFsmClass: public CActorClass
00038         {
00039         private:
00040                 char                                                                            *_Comment;                      
00041 
00042         public:
00043                 static const NLAIC::CIdentType IdFsmClass;
00044                 
00046                 void setComment(char *);
00047 
00051                 virtual void success();
00052                 virtual void failure();
00053 
00056                 virtual void success( NLAILOGIC::IBaseOperator *);
00057                 virtual void failure( NLAILOGIC::IBaseOperator *);
00058 
00059 public:
00060                 CFsmClass(const NLAIAGENT::IVarName &);
00061                 CFsmClass(const NLAIC::CIdentType &);
00062                 CFsmClass(const NLAIAGENT::IVarName &, const NLAIAGENT::IVarName &);
00063                 CFsmClass(const CFsmClass &);
00064                 CFsmClass();
00065                 virtual ~CFsmClass();
00066 
00067                 const NLAIC::IBasicType *clone() const;
00068                 const NLAIC::IBasicType *newInstance() const;
00069                 virtual void getDebugString(std::string &) const;
00070 
00071                 virtual NLAIAGENT::IObjectIA *buildNewInstance() const;
00072         };
00073 
00074 
00075 
00076         class CSeqFsmClass : public CFsmClass
00077         {
00078         private:
00079                 std::vector<NLAIAGENT::IVarName *> _Steps;
00080 
00081         public:
00082                 static const NLAIC::CIdentType IdSeqFsmClass;
00083                 
00085                 void setComment(char *);
00086 
00090                 virtual void success();
00091                 virtual void failure();
00092 
00095                 virtual void success( NLAILOGIC::IBaseOperator *);
00096                 virtual void failure( NLAILOGIC::IBaseOperator *);
00097 
00098                 const NLAIAGENT::IVarName *getStep(sint32);
00099 
00100 public:
00101                 CSeqFsmClass(const NLAIAGENT::IVarName &);
00102                 CSeqFsmClass(const NLAIC::CIdentType &);
00103                 CSeqFsmClass(const NLAIAGENT::IVarName &, const NLAIAGENT::IVarName &);
00104                 CSeqFsmClass(const CFsmClass &);
00105                 CSeqFsmClass();
00106                 ~CSeqFsmClass();
00107 
00108                 const NLAIC::IBasicType *clone() const;
00109                 const NLAIC::IBasicType *newInstance() const;
00110                 void getDebugString(char *t) const;
00111 
00112                 virtual NLAIAGENT::IObjectIA *buildNewInstance() const;
00113 
00114                 virtual void addStep(const NLAIAGENT::IVarName &);
00115         };
00116 }
00117 #endif