Home | nevrax.com |
|
agent_object.cppGo to the documentation of this file.00001 00006 /* Copyright, 2000 Nevrax Ltd. 00007 * 00008 * This file is part of NEVRAX NEL. 00009 * NEVRAX NEL is free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU General Public License as published by 00011 * the Free Software Foundation; either version 2, or (at your option) 00012 * any later version. 00013 00014 * NEVRAX NEL is distributed in the hope that it will be useful, but 00015 * WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 * General Public License for more details. 00018 00019 * You should have received a copy of the GNU General Public License 00020 * along with NEVRAX NEL; see the file COPYING. If not, write to the 00021 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 00022 * MA 02111-1307, USA. 00023 */ 00024 00025 #include "nel/ai/agent/agent.h" 00026 #include "nel/ai/agent/agent_object.h" 00027 #include "nel/ai/logic/boolval.h" 00028 #include "nel/ai/agent/object_type.h" 00029 #include "nel/ai/script/interpret_methodes.h" 00030 #include "nel/ai/agent/agent_method_def.h" 00031 00032 namespace NLAIAGENT 00033 { 00034 const NLAIC::CIdentType &CStringType::getType() const 00035 { 00036 return IdStringType; 00037 } 00038 00039 IObjetOp &CStringType::operator += (const IObjetOp &a) 00040 { 00041 const IVarName &b = (const IVarName &)a; 00042 *_Str += b; 00043 return *this; 00044 } 00045 00046 IObjetOp &CStringType::operator -= (const IObjetOp &a) 00047 { 00048 const IVarName &b = (const IVarName &)a; 00049 *_Str -= b; 00050 return *this; 00051 } 00052 00053 00054 IObjetOp *CStringType::operator < (IObjetOp &a) const 00055 { 00056 const IVarName &b = (const IVarName &)a; 00057 NLAILOGIC::CBoolType *x = new NLAILOGIC::CBoolType(*_Str < b); 00058 return x; 00059 } 00060 00061 IObjetOp *CStringType::operator > (IObjetOp &a) const 00062 { 00063 const IVarName &b = (const IVarName &)a; 00064 NLAILOGIC::CBoolType *x = new NLAILOGIC::CBoolType(*_Str > b); 00065 return x; 00066 } 00067 00068 IObjetOp *CStringType::operator <= (IObjetOp &a) const 00069 { 00070 const IVarName &b = (const IVarName &)a; 00071 NLAILOGIC::CBoolType *x = new NLAILOGIC::CBoolType(!(*_Str > b)); 00072 return x; 00073 } 00074 00075 IObjetOp *CStringType::operator >= (IObjetOp &a) const 00076 { 00077 const IVarName &b = (const IVarName &)a; 00078 NLAILOGIC::CBoolType *x = new NLAILOGIC::CBoolType(!(*_Str < b)); 00079 return x; 00080 } 00081 00082 IObjetOp *CStringType::operator != (IObjetOp &a) const 00083 { 00084 const CStringType &b = (const CStringType &)a; 00085 NLAILOGIC::CBoolType *x = new NLAILOGIC::CBoolType(!(*_Str == b.getStr())); 00086 return x; 00087 } 00088 00089 IObjetOp *CStringType::operator == (IObjetOp &a) const 00090 { 00091 const CStringType &b = (const CStringType &)a; 00092 NLAILOGIC::CBoolType *x = new NLAILOGIC::CBoolType((*_Str == b.getStr())); 00093 return x; 00094 } 00095 00096 bool CStringType::operator < (const CStringType &a) const 00097 { 00098 return *_Str < *a._Str; 00099 } 00100 00101 const IObjectIA::CProcessResult &CStringType::run() 00102 { 00103 return IObjectIA::ProcessRun; 00104 } 00105 00106 } |