本文整理汇总了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;
}