Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/cd_merge/src/util/state.h @ 6476

Last change on this file since 6476 was 6441, checked in by bensch, 19 years ago

orxonox/trunk: the Hud now scales the Widgets itself

File size: 2.1 KB
Line 
1/*!
2 * @file state.h
3 * Definition of the States Class
4*/
5
6#ifndef _STATE_H
7#define _STATE_H
8
9// FORWARD DECLARATION
10class PNode;
11class WorldEntity;
12class ObjectManager;
13
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 */
20class State {
21
22 public:
23   //////////////
24   /// CAMERA ///
25   //////////////
26  /** @param camera the PNode to the Camera, @param cameraTarget the PNode to the Camera's target */
27  static void setCamera(PNode* camera, PNode* cameraTarget);
28  /** @returns a Pointer to the PNode of the Camera */
29  static inline PNode* getCamera() { return State::camera; };
30  /** @returns a Pointer to the CameraTarget */
31  static inline PNode* getCameraTarget() { return State::cameraTarget; };
32
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; };
40
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
45  /////////////////////////
46  /// WORLD_ENTITY_LIST ///
47  /////////////////////////
48
49 private:
50  State();
51
52  static PNode*                 camera;             //!< A reference to the camera
53  static PNode*                 cameraTarget;       //!< A reference to the cameraTarget
54  static PNode*                 nullParent;         //!< A reference to the Null-PNode.
55  static ObjectManager*         objectManager;      //!< A referenct to the current ObjectManager
56
57  static unsigned int           _resX;              //!< The X Resolution of the screen.
58  static unsigned int           _resY;              //!< The Y Resolution of the screen.
59};
60
61#endif /* _STATE_H */
Note: See TracBrowser for help on using the repository browser.