Changeset 4827 in orxonox.OLD for orxonox/trunk/src/util
- Timestamp:
- Jul 9, 2005, 12:48:50 AM (19 years ago)
- Location:
- orxonox/trunk/src/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/state.cc
r4597 r4827 25 25 26 26 27 /**28 \brief standard constructor29 */30 State::State ()31 {32 this->setClassID(CL_STATE, "State");33 this->setName("State");34 27 35 this->camera = NULL; 36 this->cameraTarget = NULL; 37 } 28 const PNode* State::camera = NULL; 29 const PNode* State::cameraTarget = NULL; 38 30 39 /** 40 \brief the singleton reference to this class 41 */ 42 State* State::singletonRef = NULL; 43 44 /** 45 \brief standard deconstructor 46 */ 47 State::~State () 48 { 49 State::singletonRef = NULL; 50 51 } 31 tList<WorldEntity>* State::worldEntityList = NULL; 52 32 53 33 /** … … 56 36 void State::setCamera(const PNode* camera, const PNode* cameraTarget) 57 37 { 58 this->camera = camera;59 this->cameraTarget = cameraTarget;38 State::camera = camera; 39 State::cameraTarget = cameraTarget; 60 40 } -
orxonox/trunk/src/util/state.h
r4746 r4827 11 11 // FORWARD DEFINITION 12 12 class PNode; 13 class WorldEntity; 14 template<class T> class tList; 13 15 14 16 //! A Singleton class, that handles some states about orxonox's objects … … 16 18 17 19 public: 18 /** \returns a Pointer to the only object of this Class */ 19 inline static State* getInstance() { if (!singletonRef) singletonRef = new State(); return singletonRef; }; 20 // CAMERA // 21 /** @param camera the PNode to the Camera, @param cameraTarget the PNode to the Camera's target */ 22 static void setCamera(const PNode* camera, const PNode* cameraTarget); 23 /** @returns a Pointer to the PNode of the Camera */ 24 static inline const PNode* getCamera() { return State::camera; }; 25 /** @returns a Pointer to the CameraTarget */ 26 static inline const PNode* getCameraTarget() { return State::cameraTarget; }; 20 27 21 virtual ~State(); 22 23 void setCamera(const PNode* camera, const PNode* cameraTarget); 24 /** \returns a Pointer to the PNode of the Camera */ 25 const PNode* getCamera() const { return this->camera; }; 26 /** \returns a Pointer to the CameraTarget */ 27 const PNode* getCameraTarget() const { return this->cameraTarget; }; 28 // WORLD_ENTITY_LIST // 29 /** @param worldEntityList The World's List of WorldEntities */ 30 static inline void setWorldEntityList(tList<WorldEntity>* worldEntityList) { State::worldEntityList = worldEntityList; }; 31 /** @returns the List of WorldEntities */ 32 static inline tList<WorldEntity>* getWorldEntityList() { return State::worldEntityList; }; 28 33 29 34 private: 30 35 State(); 31 static State* singletonRef; //!< a reference to this class32 36 33 const PNode* camera; //!< A reference to the camera 34 const PNode* cameraTarget; //!< a reference to the cameraTarget 37 static const PNode* camera; //!< A reference to the camera 38 static const PNode* cameraTarget; //!< a reference to the cameraTarget 39 40 static tList<WorldEntity>* worldEntityList; //!< The List of the worldEntities 35 41 }; 36 42
Note: See TracChangeset
for help on using the changeset viewer.