/*! * @file state.h * Definition of the States Class */ #ifndef _STATE_H #define _STATE_H // FORWARD DECLARATION class PNode; class WorldEntity; class Player; class SkyBox; class StoryEntity; class ObjectManager; //! 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; }; //////////////// /// SKYBOX /// //////////////// /** @returns the current SkyBox */ static inline SkyBox* getSkyBox() { return State::skyBox; }; /** @param skyBox the SkyBox */ static inline SkyBox* setSkyBox(SkyBox* skyBox) { State::skyBox = skyBox; }; ////////////////////// /// 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; }; static inline void setResolution(unsigned int resX, unsigned int resY) { State::resX = resX; State::resY = resY; }; static inline unsigned int getResX() { return State::resX; }; static inline unsigned int getResY() { return State::resY; }; ////////////////////// /// 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; }; ////////////// /// PLAYER /// ////////////// /** @param player sets the current local player */ static inline void setPlayer(Player* player) { State::player = player; }; /** @returns the local player*/ static inline Player* getPlayer() { return State::player; }; 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 static Player* player; //!< A reference to the Player static SkyBox* skyBox; //!< The SkyBox used in the current world. static unsigned int resX; //!< The X Resolution of the screen. static unsigned int resY; //!< The Y Resolution of the screen. }; #endif /* _STATE_H */