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 |
---|
11 | class PNode; |
---|
12 | class WorldEntity; |
---|
13 | class ObjectManager; |
---|
14 | class StoryEntity; |
---|
15 | |
---|
16 | //! handles states about orxonox's most importatn objects |
---|
17 | /** |
---|
18 | * This is an abstract Class-container, not really a Class. |
---|
19 | * in this Class only static references to the most important |
---|
20 | * Objects/List/etc. are stored. |
---|
21 | */ |
---|
22 | class State { |
---|
23 | |
---|
24 | public: |
---|
25 | ////////////// |
---|
26 | /// CAMERA /// |
---|
27 | ////////////// |
---|
28 | /** @param camera the PNode to the Camera, @param cameraTarget the PNode to the Camera's target */ |
---|
29 | static void setCamera(PNode* camera, PNode* cameraTarget); |
---|
30 | /** @returns a Pointer to the PNode of the Camera */ |
---|
31 | static inline PNode* getCamera() { return State::camera; }; |
---|
32 | /** @returns a Pointer to the CameraTarget */ |
---|
33 | static inline PNode* getCameraTarget() { return State::cameraTarget; }; |
---|
34 | |
---|
35 | ////////////////////// |
---|
36 | /// OBJECT-MANAGER /// |
---|
37 | ////////////////////// |
---|
38 | /** @param objectManager the new Current ObjectManager */ |
---|
39 | static inline void setObjectManager(ObjectManager* objectManager) { State::objectManager = objectManager; }; |
---|
40 | /** @returns the current ObjectManager. */ |
---|
41 | static inline ObjectManager* getObjectManager() { return State::objectManager; }; |
---|
42 | |
---|
43 | ////////////////////// |
---|
44 | /// STORY-ENTITY /// |
---|
45 | ////////////////////// |
---|
46 | /** @param storyEntity sets the current StoryEntity that is been played */ |
---|
47 | static inline void setCurrentStoryEntity(StoryEntity* storyEntity) { State::storyEntity = storyEntity; }; |
---|
48 | /** @returns the current StoryEntity played */ |
---|
49 | static inline StoryEntity* getCurrentStoryEntity() { return State::storyEntity; }; |
---|
50 | |
---|
51 | |
---|
52 | ///////////////////////// |
---|
53 | /// WORLD_ENTITY_LIST /// |
---|
54 | ///////////////////////// |
---|
55 | |
---|
56 | private: |
---|
57 | State(); |
---|
58 | |
---|
59 | static PNode* camera; //!< A reference to the camera |
---|
60 | static PNode* cameraTarget; //!< A reference to the cameraTarget |
---|
61 | static PNode* nullParent; //!< A reference to the Null-PNode. |
---|
62 | static ObjectManager* objectManager; //!< A reference to the current ObjectManager |
---|
63 | static StoryEntity* storyEntity; //!< A reference to the current StoryEntity played |
---|
64 | |
---|
65 | }; |
---|
66 | |
---|
67 | #endif /* _STATE_H */ |
---|