Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/util/state.h @ 6491

Last change on this file since 6491 was 6468, checked in by bensch, 19 years ago

trunk: added localPlayer and SkyBox to state

File size: 2.8 KB
RevLine 
[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]10class PNode;
[4827]11class WorldEntity;
[6142]12class ObjectManager;
[6468]13class SkyBox;
14class Player;
[3655]15
[6468]16
[5405]17//! handles states about orxonox's most importatn objects
18/**
19 * This is an abstract Class-container, not really a Class.
20 * in this Class only static references to the most important
21 * Objects/List/etc. are stored.
22 */
23class State {
[3655]24
25 public:
[6142]26   //////////////
27   /// CAMERA ///
28   //////////////
[4827]29  /** @param camera the PNode to the Camera, @param cameraTarget the PNode to the Camera's target */
[6222]30  static void setCamera(PNode* camera, PNode* cameraTarget);
[4827]31  /** @returns a Pointer to the PNode of the Camera */
[6222]32  static inline PNode* getCamera() { return State::camera; };
[4827]33  /** @returns a Pointer to the CameraTarget */
[6222]34  static inline PNode* getCameraTarget() { return State::cameraTarget; };
[4485]35
[6468]36  /** @returns the Local Player */
37  static inline Player* localsPlayer() { return State::_localPlayer; };
38  /** @param localPlayer the local Player */
39  static inline void setLocalPlayer(Player* localPlayer) { State::_localPlayer = localPlayer; };
40
41  /** @returns the current SkyBox */
42  static inline SkyBox* skyBox() { return State::_skyBox; };
43  /** @param skyBox the SkyBox */
44  static inline SkyBox* setSkyBox(SkyBox* skyBox) { State::_skyBox = skyBox; };
45
46
[6142]47  //////////////////////
48  /// OBJECT-MANAGER ///
49  //////////////////////
50  /** @param objectManager the new Current ObjectManager */
51  static inline void setObjectManager(ObjectManager* objectManager) { State::objectManager = objectManager; };
52  /** @returns the current ObjectManager. */
53  static inline ObjectManager* getObjectManager() { return State::objectManager; };
[3655]54
[6468]55
[6441]56  static inline void setResolution(unsigned int resX, unsigned int resY) { State::_resX = resX; State::_resY = resY; };
57  static inline unsigned int resX() { return State::_resX; };
58  static inline unsigned int resY() { return State::_resY; };
59
[6142]60  /////////////////////////
61  /// WORLD_ENTITY_LIST ///
62  /////////////////////////
63
[3655]64 private:
[4746]65  State();
[4293]66
[6222]67  static PNode*                 camera;             //!< A reference to the camera
68  static PNode*                 cameraTarget;       //!< A reference to the cameraTarget
[5405]69  static PNode*                 nullParent;         //!< A reference to the Null-PNode.
[6142]70  static ObjectManager*         objectManager;      //!< A referenct to the current ObjectManager
[4827]71
[6468]72  static Player*                _localPlayer;       //!< The Local Player.
73  static SkyBox*                _skyBox;            //!< The SkyBox used in the current world.
[6441]74  static unsigned int           _resX;              //!< The X Resolution of the screen.
75  static unsigned int           _resY;              //!< The Y Resolution of the screen.
[6468]76  };
[3655]77
[4293]78#endif /* _STATE_H */
Note: See TracBrowser for help on using the repository browser.