| 230 | //----------------------------------------------------------------------------- |
| 231 | |
| 232 | void 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 |
no test coverage detected