Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/network/src/util/state.h @ 6493

Last change on this file since 6493 was 6493, checked in by patrick, 18 years ago

network: playable creation fix

File size: 2.6 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
10// FORWARD DECLARATION
11class PNode;
12class WorldEntity;
13class Player;
14class ObjectManager;
15class StoryEntity;
16
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 {
24
25 public:
26   //////////////
27   /// CAMERA ///
28   //////////////
29  /** @param camera the PNode to the Camera, @param cameraTarget the PNode to the Camera's target */
30  static void setCamera(PNode* camera, PNode* cameraTarget);
31  /** @returns a Pointer to the PNode of the Camera */
32  static inline PNode* getCamera() { return State::camera; };
33  /** @returns a Pointer to the CameraTarget */
34  static inline PNode* getCameraTarget() { return State::cameraTarget; };
35
36  //////////////////////
37  /// OBJECT-MANAGER ///
38  //////////////////////
39  /** @param objectManager the new Current ObjectManager */
40  static inline void setObjectManager(ObjectManager* objectManager) { State::objectManager = objectManager; };
41  /** @returns the current ObjectManager. */
42  static inline ObjectManager* getObjectManager() { return State::objectManager; };
43
44  //////////////////////
45  /// STORY-ENTITY   ///
46  //////////////////////
47  /** @param storyEntity sets the current StoryEntity that is been played */
48  static inline void setCurrentStoryEntity(StoryEntity* storyEntity) { State::storyEntity = storyEntity; };
49  /** @returns the current StoryEntity played */
50  static inline StoryEntity* getCurrentStoryEntity() { return State::storyEntity; };
51
52  //////////////
53  /// PLAYER ///
54  //////////////
55  /** @param storyEntity sets the current StoryEntity that is been played */
56  static inline void setPlayer(Player* player) { State::player = player; };
57  /** @returns the current StoryEntity played */
58  static inline Player* getPlayer() { return State::player; };
59
60  /////////////////////////
61  /// WORLD_ENTITY_LIST ///
62  /////////////////////////
63
64 private:
65  State();
66
67  static PNode*                 camera;             //!< A reference to the camera
68  static PNode*                 cameraTarget;       //!< A reference to the cameraTarget
69  static PNode*                 nullParent;         //!< A reference to the Null-PNode.
70  static ObjectManager*         objectManager;      //!< A reference to the current ObjectManager
71  static StoryEntity*           storyEntity;        //!< A reference to the current StoryEntity played
72  static Player*                player;             //!< A reference to the Player
73
74};
75
76#endif /* _STATE_H */
Note: See TracBrowser for help on using the repository browser.