/*! * @file resource.h * @brief Definition of a Resource. */ #ifndef _RESOURCE_H #define _RESOURCE_H #include "base_object.h" #include "multi_type.h" #include // FORWARD DECLARATION //! An enumerator for different (UN)LOAD-types. /** * RP_NO: will be unloaded on request * RP_LEVEL: will be unloaded at the end of a Level * RP_CAMPAIGN: will be unloaded at the end of a Campaign * RP_GAME: will be unloaded at the end of the whole Game (when closing orxonox) */ typedef enum ResourcePriority { RP_NO = 0, RP_LEVEL = 1, RP_CAMPAIGN = 2, RP_GAME = 3 }; //! A Resource is an Object, that can be loaded from Disk /** * */ class Resource : virtual public BaseObject { public: Resource(const std::string& fileName); virtual ~Resource(); virtual bool load(std::string& fileName, const MultiType& param1, const MultiType& param2); virtual bool reload(); virtual bool unload(); private: std::string fileName; unsigned int referenceCount; //!< How many times this Resource has been loaded. /// TODO REMOVE THIS: ResourceType type; //!< ResourceType of this Resource. ResourcePriority prio; //!< The Priority of this resource. (can only be increased, so noone else will delete this) MultiType param[3]; //!< The Parameters given to this Resource. }; #endif /* _RESOURCE_H */