// Call all components that implement methodName giving them a chance to operate // Components are called in reverse order of addition const char *DynamicConsoleMethodComponent::_callMethod( U32 argc, const char *argv[], bool callThis /* = true */ ) { // Set Owner SimObject *pThis = dynamic_cast<SimObject *>( this ); AssertFatal( pThis, "DynamicConsoleMethodComponent::callMethod : this should always exist!" ); const char *cbName = StringTable->insert(argv[0]); if( getComponentCount() > 0 ) { VectorPtr<SimComponent *>&componentList = lockComponentList(); for( SimComponentIterator nItr = (componentList.end()-1); nItr >= componentList.begin(); nItr-- ) { argv[0] = cbName; SimComponent *pComponent = (*nItr); AssertFatal( pComponent, "DynamicConsoleMethodComponent::callMethod - NULL component in list!" ); DynamicConsoleMethodComponent *pThisComponent = dynamic_cast<DynamicConsoleMethodComponent*>( pComponent ); AssertFatal( pThisComponent, "DynamicConsoleMethodComponent::callMethod - Non DynamicConsoleMethodComponent component attempting to callback!"); // Only call on first depth components // Should isMethod check these calls? [11/22/2006 justind] if(pComponent->isEnabled()) Con::execute( pThisComponent, argc, argv ); // Bail if this was the first element //if( nItr == componentList.begin() ) // break; } unlockComponentList(); } // Set Owner Field const char* result = ""; if(callThis) result = Con::execute( pThis, argc, argv, true ); // true - exec method onThisOnly, not on DCMCs return result; }