/*! * @file state.h * Definition of the States Class */ #ifndef _STATE_H #define _STATE_H // FORWARD DECLARATION class PNode; class WorldEntity; class ObjectManager; class StoryEntity; //! handles states about orxonox's most importatn objects /** * This is an abstract Class-container, not really a Class. * in this Class only static references to the most important * Objects/List/etc. are stored. */ class State { public: ////////////// /// CAMERA /// ////////////// /** @param camera the PNode to the Camera, @param cameraTarget the PNode to the Camera's target */ static void setCamera(PNode* camera, PNode* cameraTarget); /** @returns a Pointer to the PNode of the Camera */ static inline PNode* getCamera() { return State::camera; }; /** @returns a Pointer to the CameraTarget */ static inline PNode* getCameraTarget() { return State::cameraTarget; }; ////////////////////// /// OBJECT-MANAGER /// ////////////////////// /** @param objectManager the new Current ObjectManager */ static inline void setObjectManager(ObjectManager* objectManager) { State::objectManager = objectManager; }; /** @returns the current ObjectManager. */ static inline ObjectManager* getObjectManager() { return State::objectManager; }; ////////////////////// /// STORY-ENTITY /// ////////////////////// /** @param storyEntity sets the current StoryEntity that is been played */ static inline void setCurrentStoryEntity(StoryEntity* storyEntity) { State::storyEntity = storyEntity; }; /** @returns the current StoryEntity played */ static inline StoryEntity* getCurrentStoryEntity() { return State::storyEntity; }; ///////////////////////// /// WORLD_ENTITY_LIST /// ///////////////////////// private: State(); static PNode* camera; //!< A reference to the camera static PNode* cameraTarget; //!< A reference to the cameraTarget static PNode* nullParent; //!< A reference to the Null-PNode. static ObjectManager* objectManager; //!< A reference to the current ObjectManager static StoryEntity* storyEntity; //!< A reference to the current StoryEntity played }; #endif /* _STATE_H */