Changeset 9783 in orxonox.OLD for branches/new_class_id/src/lib/util
- Timestamp:
- Sep 21, 2006, 7:10:42 PM (18 years ago)
- Location:
- branches/new_class_id/src/lib/util/loading
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/util/loading/resource.cc
r9718 r9783 37 37 // delete what has to be deleted here 38 38 } 39 40 41 42 43 44 45 46 47 void Resource::KeepLevel::setKeepLevelName(unsigned int level, const std::string& name) 48 { 49 if (_keepLevelName.size() <= level) 50 _keepLevelName.resize(level+1); 51 _keepLevelName[level] = name; 52 } -
branches/new_class_id/src/lib/util/loading/resource.h
r9758 r9783 24 24 { 25 25 public: 26 void setKeepLevelName(unsigned int level, const std::string& name) 27 { 28 if (_keepLevelName.size() <= level) 29 _keepLevelName.resize(level+1); 30 _keepLevelName[level] = name; 31 } 26 void setKeepLevelName(unsigned int level, const std::string& name); 32 27 private: 33 28 std::vector<std::string> _keepLevelName; 34 29 }; 35 30 36 31 protected: 37 32 class Type 38 33 { 39 34 public: 40 Type(const ClassID& classID) : _ classID(classID) { };35 Type(const ClassID& classID) : _id(-1), _classID(classID) { }; 41 36 42 37 void addExtension(const std::string& extension); 43 38 39 const ClassID& storedClassID() const { return _classID; }; 40 int id() const { return _id; }; 41 const std::vector<std::string>& resourcePaths() const { return _resourcePaths; }; 42 43 44 void setID(int id); 45 44 46 private: 47 int _id; 45 48 const ClassID& _classID; 46 49 std::vector<std::string> _resourcePaths; … … 49 52 }; 50 53 54 class Pointer {}; 51 55 52 56 … … 55 59 virtual ~Resource(); 56 60 57 virtual bool load(std::string& fileName, const MultiType& param1, const MultiType& param2);61 bool loadResource(std::string& fileName, Resource::Pointer* ptr); 58 62 virtual bool reload(); 59 63 virtual bool unload(); 60 64 61 65 66 62 67 private: 68 std::string _loadString; //!< An identifier, to match when loading a File. 63 69 std::string _fileName; 64 70 MultiType _parameters[3]; //!< The Parameters given to this Resource.
Note: See TracChangeset
for help on using the changeset viewer.