From: Oliver O. <fr...@us...> - 2007-06-17 13:39:37
|
Update of /cvsroot/simspark/simspark/spark/oxygen/agentaspect In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv21072/oxygen/agentaspect Modified Files: agentaspect.cpp agentaspect.h effector.h Log Message: merge from projectx branch Index: effector.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/agentaspect/effector.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** effector.h 5 Dec 2005 21:16:49 -0000 1.1 --- effector.h 17 Jun 2007 13:38:32 -0000 1.2 *************** *** 1,5 **** /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- ! this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University --- 1,5 ---- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- ! this file is part of simspark Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University *************** *** 23,30 **** #define OXYGEN_EFFECTOR_H - // #ifdef HAVE_CONFIG_H - // #include <config.h> - // #endif - #include <oxygen/sceneserver/basenode.h> #include <oxygen/gamecontrolserver/baseparser.h> --- 23,26 ---- Index: agentaspect.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/agentaspect/agentaspect.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** agentaspect.h 5 Dec 2005 21:16:49 -0000 1.1 --- agentaspect.h 17 Jun 2007 13:38:32 -0000 1.2 *************** *** 1,5 **** /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- ! this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University --- 1,5 ---- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- ! this file is part of simspark Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University *************** *** 23,30 **** #define OXYGEN_AGENTASPECT_H - // #ifdef HAVE_CONFIG_H - // #include <config.h> - // #endif - #include <oxygen/sceneserver/transform.h> #include <oxygen/gamecontrolserver/actionobject.h> --- 23,26 ---- *************** *** 46,54 **** /** Initializes the AgentAspect. Called immediately after the ! AgentAspect is created by the GameControlServer. \param ! createEffector is the name of the initial effector class that ! the agent uses to construct all remaining parts */ ! virtual bool Init(const std::string& createEffector); /** RealizeActions realizes the actions described by \param --- 42,51 ---- /** Initializes the AgentAspect. Called immediately after the ! AgentAspect is created by the GameControlServer. ! \param createEffector is the name of the initial effector class that ! the agent uses to construct all remaining parts ! \param id a unique ID to set */ ! virtual bool Init(const std::string& createEffector, int id); /** RealizeActions realizes the actions described by \param *************** *** 68,71 **** --- 65,71 ---- virtual boost::shared_ptr<Effector> GetEffector(const std::string predicate) const; + //! @return the unique ID for the agent aspect + inline int ID() const { return mID; } + protected: typedef std::map<std::string, boost::shared_ptr<Effector> > TEffectorMap; *************** *** 75,78 **** --- 75,79 ---- private: + int mID; }; Index: agentaspect.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/agentaspect/agentaspect.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** agentaspect.cpp 5 Dec 2005 21:16:49 -0000 1.1 --- agentaspect.cpp 17 Jun 2007 13:38:32 -0000 1.2 *************** *** 1,5 **** /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- ! this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University --- 1,5 ---- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- ! this file is part of simspark Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University *************** *** 31,34 **** --- 31,35 ---- { SetName("agentAspect"); + mID = -1; } *************** *** 130,135 **** bool ! AgentAspect::Init(const string& createEffector) { shared_ptr<Effector> create = shared_dynamic_cast<Effector> (GetCore()->New(createEffector)); --- 131,138 ---- bool ! AgentAspect::Init(const string& createEffector, int id) { + mID = id; + shared_ptr<Effector> create = shared_dynamic_cast<Effector> (GetCore()->New(createEffector)); |