[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; |
---|
[6142] | 12 | class ObjectManager; |
---|
[3655] | 13 | |
---|
[5405] | 14 | //! handles states about orxonox's most importatn objects |
---|
| 15 | /** |
---|
| 16 | * This is an abstract Class-container, not really a Class. |
---|
| 17 | * in this Class only static references to the most important |
---|
| 18 | * Objects/List/etc. are stored. |
---|
| 19 | */ |
---|
| 20 | class State { |
---|
[3655] | 21 | |
---|
| 22 | public: |
---|
[6142] | 23 | ////////////// |
---|
| 24 | /// CAMERA /// |
---|
| 25 | ////////////// |
---|
[4827] | 26 | /** @param camera the PNode to the Camera, @param cameraTarget the PNode to the Camera's target */ |
---|
[6222] | 27 | static void setCamera(PNode* camera, PNode* cameraTarget); |
---|
[4827] | 28 | /** @returns a Pointer to the PNode of the Camera */ |
---|
[6222] | 29 | static inline PNode* getCamera() { return State::camera; }; |
---|
[4827] | 30 | /** @returns a Pointer to the CameraTarget */ |
---|
[6222] | 31 | static inline PNode* getCameraTarget() { return State::cameraTarget; }; |
---|
[4485] | 32 | |
---|
[6142] | 33 | ////////////////////// |
---|
| 34 | /// OBJECT-MANAGER /// |
---|
| 35 | ////////////////////// |
---|
| 36 | /** @param objectManager the new Current ObjectManager */ |
---|
| 37 | static inline void setObjectManager(ObjectManager* objectManager) { State::objectManager = objectManager; }; |
---|
| 38 | /** @returns the current ObjectManager. */ |
---|
| 39 | static inline ObjectManager* getObjectManager() { return State::objectManager; }; |
---|
[3655] | 40 | |
---|
[6441] | 41 | static inline void setResolution(unsigned int resX, unsigned int resY) { State::_resX = resX; State::_resY = resY; }; |
---|
| 42 | static inline unsigned int resX() { return State::_resX; }; |
---|
| 43 | static inline unsigned int resY() { return State::_resY; }; |
---|
| 44 | |
---|
[6142] | 45 | ///////////////////////// |
---|
| 46 | /// WORLD_ENTITY_LIST /// |
---|
| 47 | ///////////////////////// |
---|
| 48 | |
---|
[3655] | 49 | private: |
---|
[4746] | 50 | State(); |
---|
[4293] | 51 | |
---|
[6222] | 52 | static PNode* camera; //!< A reference to the camera |
---|
| 53 | static PNode* cameraTarget; //!< A reference to the cameraTarget |
---|
[5405] | 54 | static PNode* nullParent; //!< A reference to the Null-PNode. |
---|
[6142] | 55 | static ObjectManager* objectManager; //!< A referenct to the current ObjectManager |
---|
[4827] | 56 | |
---|
[6441] | 57 | static unsigned int _resX; //!< The X Resolution of the screen. |
---|
| 58 | static unsigned int _resY; //!< The Y Resolution of the screen. |
---|
[3655] | 59 | }; |
---|
| 60 | |
---|
[4293] | 61 | #endif /* _STATE_H */ |
---|