当前位置: 首页>>代码示例>>C++>>正文


C++ SimObject::processArguments方法代码示例

本文整理汇总了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()));
                     }
开发者ID:AltimorTASDK,项目名称:TribesRebirth,代码行数:67,代码来源:FearMissionPlugin.cpp


注:本文中的SimObject::processArguments方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。