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

Method callOnChildren

Engine/source/console/simSet.cpp:232–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230//-----------------------------------------------------------------------------
231
232void SimSet::callOnChildren( const String &method, S32 argc, ConsoleValueRef argv[], bool executeOnChildGroups )
233{
234 // Prep the arguments for the console exec...
235 // Make sure and leave args[1] empty.
236 ConsoleValueRef args[21] = { };
237 ConsoleValue name_method;
238 name_method.setStackStringValue(method.c_str());
239 args[0] = ConsoleValueRef::fromValue(&name_method);
240
241 for (S32 i = 0; i < argc; i++)
242 args[i + 2] = argv[i];
243
244 for( iterator i = begin(); i != end(); i++ )
245 {
246 SimObject *childObj = static_cast<SimObject*>(*i);
247
248 if( childObj->isMethod( method.c_str() ) )
249 Con::execute(childObj, argc + 2, args);
250
251 if( executeOnChildGroups )
252 {
253 SimSet* childSet = dynamic_cast<SimSet*>(*i);
254 if ( childSet )
255 childSet->callOnChildren( method, argc, argv, executeOnChildGroups );
256 }
257 }
258}
259
260//-----------------------------------------------------------------------------
261

Callers 1

simSet.cppFile · 0.80

Calls 6

beginFunction · 0.85
endFunction · 0.85
executeFunction · 0.85
setStackStringValueMethod · 0.80
isMethodMethod · 0.80
c_strMethod · 0.45

Tested by

no test coverage detected