Changeset 4827 in orxonox.OLD for orxonox/trunk/src/util/state.h
- Timestamp:
- Jul 9, 2005, 12:48:50 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.