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

Method findObjectByLineNumber

Engine/source/console/simSet.cpp:500–530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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