# 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  

msg_notify.cpp

Go 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/msg_notify.h"
00026 #include "nel/ai/agent/agent_digital.h"
00027 #include "nel/ai/script/interpret_object_message.h"
00028 
00029 namespace NLAIAGENT
00030 {
00031         CNotifyParentScript::CNotifyParentScript( std::list<IObjectIA *> &l, NLAISCRIPT::CMessageClass *b):CMessageScript(l,b)
00032         {
00033                 /*set(0,new DigitalType(0.0));
00034                 set(1,new CLocalAgentMail(NULL));*/
00035         }
00036 
00037         CNotifyParentScript::CNotifyParentScript(NLAISCRIPT::CMessageClass *b):CMessageScript(b)
00038         {               
00039                 /*CVectorGroupType *x = new CVectorGroupType(2);                
00040                 setMessageGroup(x);
00041                 setGroup(CMessageGroup::msgScriptingGroup);             
00042                 set(0,new DigitalType(0.0));
00043                 set(1,new CLocalAgentMail(NULL));*/
00044         }
00045 
00046         CNotifyParentScript::CNotifyParentScript(IBasicAgent *agent):
00047                         CMessageScript((NLAISCRIPT::CMessageClass *)NLAISCRIPT::CMsgNotifyParentClass::IdMsgNotifyParentClass.getFactory()->getClass())
00048         {               
00049                 /*CVectorGroupType *x = new CVectorGroupType(2);
00050                 setMessageGroup(x);
00051                 setGroup(CMessageGroup::msgScriptingGroup);
00052                 if(agent == NULL)
00053                 {
00054                         set(0,new DigitalType(0.0));
00055                         set(1,new CLocalAgentMail(NULL));
00056                 }
00057                 else
00058                 {
00059                         set(0,new DigitalType(1.0));
00060                         set(1,new CLocalAgentMail(agent));
00061                 }*/
00062         }
00063 
00064         CNotifyParentScript::CNotifyParentScript(const CNotifyParentScript &m): CMessageScript(m)
00065         {
00066         }
00067 
00068         const NLAIC::IBasicType *CNotifyParentScript::clone() const
00069         {
00070                 /*if(((const INombreDefine *)getFront())->getNumber() != 0.0)
00071                 {
00072                         //CLocalAgentMail *g = (CLocalAgentMail *)get();
00073                         return new CNotifyParentScript(*this);
00074                 }
00075                 else
00076                 {
00077                         return new CNotifyParentScript();
00078                 }*/
00079                 return new CNotifyParentScript(*this);
00080         }
00081 
00082         const NLAIC::CIdentType &CNotifyParentScript::getType() const
00083         {
00084                 if ( getCreatorClass() ) 
00085                         return getCreatorClass()->getType();
00086                 else
00087                         return IdNotifyParentScript;
00088         }       
00089 
00090         void CNotifyParentScript::getDebugString(std::string &t) const
00091         {
00092                 double i = ((const INombreDefine *)getFront())->getNumber();
00093                 if(i != 0.0)
00094                 {
00095                         std::string txt;
00096                         get()->getDebugString(txt);
00097                         t += NLAIC::stringGetBuild("CNotifyParentScript<true,%s>",txt.c_str());
00098                 }
00099                 else
00100                 {
00101                         t += "CNotifyParentScript<false,NULL>";
00102                 }
00103         }
00104 }