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

Method removeDependency

Engine/source/module/moduleDefinition.cpp:168–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Calls 6

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

Tested by

no test coverage detected