| 165 | //----------------------------------------------------------------------------- |
| 166 | |
| 167 | bool ModuleDefinition::removeDependency( const char* pModuleId ) |
| 168 | { |
| 169 | // Fetch module Id. |
| 170 | StringTableEntry moduleId = StringTable->insert( pModuleId ); |
| 171 | |
| 172 | // Do we have any existing dependencies? |
| 173 | if ( mDependencies.size() > 0 ) |
| 174 | { |
| 175 | // Yes, so is the module Id a dependency? |
| 176 | for( typeModuleDependencyVector::iterator dependencyItr = mDependencies.begin(); dependencyItr != mDependencies.end(); ++dependencyItr ) |
| 177 | { |
| 178 | // Skip if not the same module Id. |
| 179 | if ( dependencyItr->mModuleId != moduleId ) |
| 180 | continue; |
| 181 | |
| 182 | // Remove dependency. |
| 183 | mDependencies.erase( dependencyItr ); |
| 184 | |
| 185 | return true; |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | // No, so warn. |
| 190 | Con::warnf("Could not remove dependency of module Id '%s' as the module Id is not a dependency.", pModuleId ); |
| 191 | return false; |
| 192 | } |
| 193 | |
| 194 | //----------------------------------------------------------------------------- |
| 195 | |