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


C++ Aircraft::callsign方法代码示例

本文整理汇总了C++中Aircraft::callsign方法的典型用法代码示例。如果您正苦于以下问题:C++ Aircraft::callsign方法的具体用法?C++ Aircraft::callsign怎么用?C++ Aircraft::callsign使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Aircraft的用法示例。


在下文中一共展示了Aircraft::callsign方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main(void)
{
   sg::PWorld world;
   sg::PWorldInterface wi;
   sg::PWorldInterface wi2;
    
   try
   {
      world = abidos::load_world( "FooWorld", "/home/thomas.cocagne/devel/stargate/test_world.wdf" );

      wi = abidos::createWorldInterface( "test_iface", world );

      wi2 = abidos::createWorldInterface( "test_iface2", world );

      if (!wi || !wi2)
      {
         cerr << "Failed to create world interface!!!" << endl;
         return 0;
      }
   } 
   catch (abidos::LoadError & e)
   {
      cerr << "Failed to load world!: " << e.what() << endl;
      return 0;
   }

//    return 0;
    
   cerr << "************ World Types *************" << endl;
    
   world->printTypes();
    
   cerr << "**************************************" << endl;
    
    
   //PhysicalEntityObject po = wi->createObject<PhysicalEntityObject>();

   wi2->setNewObjectHandler( PhysicalEntity::ID, test_cb );
   
   wi2->setNewObjectHandler< VehicleObject >( test2_cb );
   
   cerr << " %% Running Callbacks (should be empty) %% " << endl;
   
   wi2->runCallbacks();
   
   AircraftObject po = wi->createObject<AircraftObject>();
    
   cerr << "******* object created ********" << endl;

   cerr << "FQ Latitude: " << po.getInstance().loc().pos().longitude() << endl;
    
   PhysicalEntity pe = po.getInstance();
    
   cerr << "Got Instance" << endl;
    
   Location l = pe.loc();
    
   cerr << "Got Location" << endl;
    
   Position p = l.pos();
    
   cerr << "Got Position" << endl;
    
   cerr << "Lat, lon, alt = " << p.latitude() << ", " << p.longitude() << ", " << p.altitude() << endl;
    
   p.latitude( 3.14159 );
        
   cerr << "Lat, lon, alt = " << p.latitude() << ", " << p.longitude() << ", " << p.altitude() << endl;

   // String test
   Aircraft a = po.getInstance();

   cerr << "Callsign: " << (const char *) (a.callsign()->data()) << endl;

   a.callsign( "Foo Bar" );

   cerr << "Callsign: " << (const char *) (a.callsign()->data()) << endl;

   cerr << " %% Running Callbacks (should see 1) %% " << endl;
   wi2->runCallbacks();
    
   return 0;
}
开发者ID:cocagne,项目名称:scratch,代码行数:83,代码来源:test.cpp


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