00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef NL_TEST_METHOD_H
00026 #define NL_TEST_METHOD_H
00027
00028 namespace NLAISCRIPT
00029 {
00039 class CLibTest: public NLAIAGENT::IObjectIA
00040 {
00041 public:
00043 enum TMethodNumDef {
00044
00045 TIsNULL,
00046 TRand1,
00047 TRand2,
00048 TDiscretRand,
00049 TConst,
00050
00051
00052
00053
00054
00055
00056 TLastM
00057 };
00058
00059 enum TTypeCheck{
00060 CheckAll,
00061 CheckCount,
00062 DoNotCheck
00063 };
00064
00066 struct CMethodCall
00067 {
00068 CMethodCall(const char *name, int i,NLAIAGENT::IObjectIA *a,TTypeCheck checkArg,int argCount, NLAIAGENT::IObjectIA *r):
00069 MethodName (name),ArgType(a),ReturnValue(r)
00070 {
00071 Index = i;
00072 CheckArgType = checkArg;
00073 ArgCount = argCount;
00074 }
00075
00076 ~CMethodCall()
00077 {
00078 if(ReturnValue != NULL) ReturnValue->release();
00079 if(ArgType != NULL) ArgType->release();
00080 }
00082 NLAIAGENT::CStringVarName MethodName;
00084 NLAIAGENT::IObjectIA *ArgType;
00086 NLAIAGENT::IObjectIA *ReturnValue;
00088 TTypeCheck CheckArgType;
00090 sint ArgCount;
00092 sint32 Index;
00093 };
00095 static CMethodCall **StaticMethod;
00096
00097 public:
00098 static const NLAIC::CIdentType IdLibTest;
00099
00100 public:
00101 CLibTest();
00102
00104
00105 virtual sint32 isClassInheritedFrom(const NLAIAGENT::IVarName &) const;
00106
00107 virtual sint32 getMethodIndexSize() const
00108 {
00109 return 0;
00110 }
00111
00112 double rand(double,double) const;
00113 sint dRand(sint, sint) const;
00114 virtual NLAIAGENT::tQueue isMember(const NLAIAGENT::IVarName *className,const NLAIAGENT::IVarName *mathodName,const NLAIAGENT::IObjectIA &) const;
00115 virtual NLAIAGENT::IObjectIA::CProcessResult runMethodeMember(sint32 heritance, sint32 index, NLAIAGENT::IObjectIA *);
00116 virtual NLAIAGENT::IObjectIA::CProcessResult runMethodeMember(sint32 index,NLAIAGENT::IObjectIA *);
00117
00118 const NLAIAGENT::IObjectIA::CProcessResult &run(){return NLAIAGENT::IObjectIA::ProcessRun;}
00119 bool isEqual(const NLAIAGENT::IBasicObjectIA &a) const{ return true;}
00121
00123
00124 const NLAIC::IBasicType *clone() const
00125 {
00126 NLAIC::IBasicType *x = new CLibTest();
00127 return x;
00128 }
00129
00130 const NLAIC::IBasicType *newInstance() const
00131 {
00132 return clone();
00133 }
00134
00135 const NLAIC::CIdentType &getType() const
00136 {
00137 return IdLibTest;
00138 }
00139
00140 virtual void getDebugString(std::string &t) const
00141 {
00142 t = "lib for serveral testing state";
00143 }
00144
00145 void save(NLMISC::IStream &os)
00146 {
00147
00148 }
00149
00150 void load(NLMISC::IStream &is)
00151 {
00152 }
00154
00155 public:
00156 static void initClass();
00157 static void releaseClass();
00158 };
00159 }
00160 #endif