[4597] | 1 | /*! |
---|
[5039] | 2 | * @file state.h |
---|
[5405] | 3 | * Definition of the States Class |
---|
[3655] | 4 | */ |
---|
| 5 | |
---|
[4293] | 6 | #ifndef _STATE_H |
---|
| 7 | #define _STATE_H |
---|
[3655] | 8 | |
---|
[5405] | 9 | // FORWARD DECLARATION |
---|
[4293] | 10 | class PNode; |
---|
[4827] | 11 | class WorldEntity; |
---|
| 12 | template<class T> class tList; |
---|
[6121] | 13 | class ObjectManager; |
---|
[3655] | 14 | |
---|
[5405] | 15 | //! handles states about orxonox's most importatn objects |
---|
| 16 | /** |
---|
| 17 | * This is an abstract Class-container, not really a Class. |
---|
| 18 | * in this Class only static references to the most important |
---|
| 19 | * Objects/List/etc. are stored. |
---|
| 20 | */ |
---|
| 21 | class State { |
---|
[3655] | 22 | |
---|
| 23 | public: |
---|
[6121] | 24 | ////////////// |
---|
| 25 | /// CAMERA /// |
---|
| 26 | ////////////// |
---|
[4827] | 27 | /** @param camera the PNode to the Camera, @param cameraTarget the PNode to the Camera's target */ |
---|
| 28 | static void setCamera(const PNode* camera, const PNode* cameraTarget); |
---|
| 29 | /** @returns a Pointer to the PNode of the Camera */ |
---|
| 30 | static inline const PNode* getCamera() { return State::camera; }; |
---|
| 31 | /** @returns a Pointer to the CameraTarget */ |
---|
| 32 | static inline const PNode* getCameraTarget() { return State::cameraTarget; }; |
---|
[4485] | 33 | |
---|
[6121] | 34 | ////////////////////// |
---|
| 35 | /// OBJECT-MANAGER /// |
---|
| 36 | ////////////////////// |
---|
| 37 | /** @param objectManager the new Current ObjectManager */ |
---|
| 38 | static inline void setObjectManager(ObjectManager* objectManager) { State::objectManager = objectManager; }; |
---|
| 39 | /** @returns the current ObjectManager. */ |
---|
| 40 | static inline ObjectManager* getObjectManager() { return State::objectManager; }; |
---|
| 41 | |
---|
| 42 | ///////////////////////// |
---|
| 43 | /// WORLD_ENTITY_LIST /// |
---|
| 44 | ///////////////////////// |
---|
[4827] | 45 | /** @param worldEntityList The World's List of WorldEntities */ |
---|
| 46 | static inline void setWorldEntityList(tList<WorldEntity>* worldEntityList) { State::worldEntityList = worldEntityList; }; |
---|
| 47 | /** @returns the List of WorldEntities */ |
---|
| 48 | static inline tList<WorldEntity>* getWorldEntityList() { return State::worldEntityList; }; |
---|
[3655] | 49 | |
---|
| 50 | private: |
---|
[4746] | 51 | State(); |
---|
[4293] | 52 | |
---|
[4827] | 53 | static const PNode* camera; //!< A reference to the camera |
---|
[5405] | 54 | static const PNode* cameraTarget; //!< A reference to the cameraTarget |
---|
| 55 | static PNode* nullParent; //!< A reference to the Null-PNode. |
---|
[6121] | 56 | static ObjectManager* objectManager; //!< A referenct to the current ObjectManager |
---|
[4827] | 57 | |
---|
| 58 | static tList<WorldEntity>* worldEntityList; //!< The List of the worldEntities |
---|
[5405] | 59 | |
---|
| 60 | //tStack< |
---|
[3655] | 61 | }; |
---|
| 62 | |
---|
[4293] | 63 | #endif /* _STATE_H */ |
---|