MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / removeDependency

Method removeDependency

Engine/source/module/moduleDefinition.cpp:167–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165//-----------------------------------------------------------------------------
166
167bool 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

Calls 6

warnfFunction · 0.85
insertMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected