本文整理汇总了C++中SimObject::isMethod方法的典型用法代码示例。如果您正苦于以下问题:C++ SimObject::isMethod方法的具体用法?C++ SimObject::isMethod怎么用?C++ SimObject::isMethod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimObject
的用法示例。
在下文中一共展示了SimObject::isMethod方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handlesConsoleMethod
//-----------------------------------------------------------
// Function name: SimComponent::handlesConsoleMethod
// Summary:
//-----------------------------------------------------------
bool DynamicConsoleMethodComponent::handlesConsoleMethod( const char *fname, S32 *routingId )
{
// CodeReview: Host object is now given priority over components for method
// redirection. [6/23/2007 Pat]
// On this object?
if( isMethod( fname ) )
{
*routingId = -1; // -1 denotes method on object
return true;
}
// on this objects components?
S32 nI = 0;
VectorPtr<SimComponent*> &componentList = lockComponentList();
for( SimComponentIterator nItr = componentList.begin(); nItr != componentList.end(); nItr++, nI++ )
{
SimObject *pComponent = dynamic_cast<SimObject*>(*nItr);
if( pComponent != NULL && pComponent->isMethod( fname ) )
{
*routingId = -2; // -2 denotes method on component
unlockComponentList();
return true;
}
}
unlockComponentList();
return false;
}
示例2: callOnChildren
void SimSet::callOnChildren( const String &method, S32 argc, ConsoleValueRef argv[], bool executeOnChildGroups )
{
// Prep the arguments for the console exec...
// Make sure and leave args[1] empty.
ConsoleValueRef args[21];
args[0] = method.c_str();
for (S32 i = 0; i < argc; i++)
args[i + 2] = argv[i];
for( iterator i = begin(); i != end(); i++ )
{
SimObject *childObj = static_cast<SimObject*>(*i);
if( childObj->isMethod( method.c_str() ) )
Con::execute(childObj, argc + 2, args);
if( executeOnChildGroups )
{
SimSet* childSet = dynamic_cast<SimSet*>(*i);
if ( childSet )
childSet->callOnChildren( method, argc, argv, executeOnChildGroups );
}
}
}