Changeset 9845 in orxonox.OLD for branches/new_class_id/src/lib/util/loading/resource.cc
- Timestamp:
- Sep 27, 2006, 11:13:17 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/util/loading/resource.cc
r9843 r9845 137 137 ////////////// 138 138 Type::Type(const std::string& typeName) 139 : _ id(-1), _typeName(typeName)139 : _typeName(typeName) 140 140 { 141 141 ResourceManager::getInstance()->registerType(this); … … 151 151 { 152 152 this->_storedResources.push_back(resource); 153 154 153 } 155 154 … … 175 174 } 176 175 177 178 void Type::setID(int id) 179 { 180 this->_id = id; 176 void Type::unloadAllBelowKeepLevel(const Resources::KeepLevel& keepLevel) 177 { 178 std::vector<Resources::StorePointer*>::iterator it; 179 for (it = this->_storedResources.begin(); it != this->_storedResources.end(); ++it) 180 if((*it)->keepLevel() < keepLevel) 181 { 182 delete (*it); 183 this->_storedResources.erase(it); 184 it = this->_storedResources.begin(); 185 } 181 186 } 182 187 … … 184 189 void Type::debug() const 185 190 { 186 PRINT(0)(" ResourceType '%s' with ID %d stores %d Resources\n", this->_typeName.c_str(), this->_id, this->_storedResources.size());191 PRINT(0)(" ResourceType '%s' stores %d Resources\n", this->_typeName.c_str(), this->_storedResources.size()); 187 192 PRINT(0)(" Paths:\n"); 188 193 for (unsigned int i = 0; i < this->_resourcePaths.size(); ++i)
Note: See TracChangeset
for help on using the changeset viewer.