本文整理汇总了C++中SimObject::processArguments方法的典型用法代码示例。如果您正苦于以下问题:C++ SimObject::processArguments方法的具体用法?C++ SimObject::processArguments怎么用?C++ SimObject::processArguments使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimObject
的用法示例。
在下文中一共展示了SimObject::processArguments方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: return
//.........这里部分代码省略.........
serverManager->lock();
if ( argc >= 3 )
{
// find a name to use
char strname[255];
int count = 1;
do
{
sprintf(strname, "%s%d", argv[1], count);
count++;
}
while( serverManager->findObject( strname ) );
// must have mission editor for this command
if( me )
{
Persistent::Base * obj = reinterpret_cast< Persistent::Base* >
( Persistent::create( argv[2] ) );
SimObject *simObj;
if( obj )
{
simObj = dynamic_cast<SimObject *>( obj );
if(simObj)
{
if(!serverManager->addObject( simObj ))
{
console->printf("MissionCreateObject: failed on addObject");
break;
}
serverManager->assignName( simObj, strname );
if( !simObj->processArguments( argc - 3, argv + 3 ) )
{
simObj->deleteObject();
console->printf("MissionCreateObject: failed argument list");
}
else
{
// add to the mission editor
if( !me->addObject( simObj ) )
simObj->deleteObject();
// grab the centroid for 'DropToSelectedObj'
me->mSelection.calcCentroid();
// make this the only selection
console->evaluatef( "MissionObjectList::ClearSelection();" );
console->evaluatef( "MissionObjectList::SelectObject( %d, %d );",
me->getWorldId( simObj ), simObj->getId() );
// move the item where we want it...
me->onDrop( simObj, me->mDropType );
// re-select to get inspect...
console->evaluatef( "MissionObjectList::Inspect( %d, %d );",
me->getWorldId( simObj ), simObj->getId() );
// check if should drop to ground
if( me->mFlags.test( FearMissionEditor::DropToGround ) )
me->dropObjectDown( simObj );
serverManager->unlock();
return(avar("%d", simObj->getId()));
}