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

Method findObjectByLineNumber

Engine/source/console/simSet.cpp:502–532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

500//-----------------------------------------------------------------------------
501
502SimObject* SimSet::findObjectByLineNumber(const char* fileName, S32 declarationLine, bool searchChildren)
503{
504 if (!fileName)
505 return NULL;
506
507 if (declarationLine < 0)
508 return NULL;
509
510 StringTableEntry fileEntry = StringTable->insert(fileName);
511
512 for (iterator i = begin(); i != end(); i++)
513 {
514 SimObject *childObj = static_cast<SimObject*>(*i);
515
516 if(childObj->getFilename() == fileEntry && childObj->getDeclarationLine() == declarationLine)
517 return childObj;
518 else if (searchChildren)
519 {
520 SimSet* childSet = dynamic_cast<SimSet*>(*i);
521
522 if (childSet)
523 {
524 SimObject* found = childSet->findObjectByLineNumber(fileName, declarationLine, searchChildren);
525 if (found)
526 return found;
527 }
528 }
529 }
530
531 return NULL;
532}
533
534//-----------------------------------------------------------------------------
535

Callers 1

findObjectFunction · 0.80

Calls 5

beginFunction · 0.85
endFunction · 0.85
getDeclarationLineMethod · 0.80
insertMethod · 0.45
getFilenameMethod · 0.45

Tested by

no test coverage detected