/*! * @file state.h * Definition of the States Class */ #ifndef _STATE_H #define _STATE_H // FORWARD DECLARATION class PNode; class WorldEntity; template class tList; 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(const PNode* camera, const PNode* cameraTarget); /** @returns a Pointer to the PNode of the Camera */ static inline const PNode* getCamera() { return State::camera; }; /** @returns a Pointer to the CameraTarget */ static inline const 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; }; ///////////////////////// /// WORLD_ENTITY_LIST /// ///////////////////////// /** @param worldEntityList The World's List of WorldEntities */ static inline void setWorldEntityList(tList* worldEntityList) { State::worldEntityList = worldEntityList; }; /** @returns the List of WorldEntities */ static inline tList* getWorldEntityList() { return State::worldEntityList; }; private: State(); static const PNode* camera; //!< A reference to the camera static const PNode* cameraTarget; //!< A reference to the cameraTarget static PNode* nullParent; //!< A reference to the Null-PNode. static ObjectManager* objectManager; //!< A referenct to the current ObjectManager static tList* worldEntityList; //!< The List of the worldEntities //tStack< }; #endif /* _STATE_H */