本文整理汇总了C++中ConfigManager::save方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigManager::save方法的具体用法?C++ ConfigManager::save怎么用?C++ ConfigManager::save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigManager
的用法示例。
在下文中一共展示了ConfigManager::save方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: func
//.........这里部分代码省略.........
const ComponentsByType& components = i->second->getComponentsByType();
for( ComponentsByType::const_iterator j = components.begin();
j != components.end(); ++j )
{
pluginManager.getPlugin<ClientObjectManager>().getObject( i->first ).destroyComponent( j->first );
}
}
catch ( Exception e )
{
LOGE << "Could not destroy object: " << e.getDescription();
}
}
}
if (ch=='l' || ch=='L')
{
// List all objects.
LOGI << "Listing all objects:";
const Objects& objects = pluginManager.getPlugin<ClientObjectManager>().getObjects();
for( Objects::const_iterator i = objects.begin(); i != objects.end(); ++i )
{
LOGI << "[" << i->second->getName() << "]"
<< " T:" << i->second->getNetworkingType()
<< " S:" << i->second->getSource()
<< " SID:" << i->second->GetCreatingSystemGUID().g
//<< " Pos: " << ( i->second->hasComponent<Position>() ? i->second->getComponent<Position>().get( "Position" ).to<Vector3>() : "No position" )
<< " Parent: " << ( i->second->hasParent() ? i->second->getParent()->getName() : "No parent" );
}
}
if (ch=='r' || ch=='R')
{
// Change all objects to remote.
LOGI << "Setting all objects to remote.";
const Objects& objects = pluginManager.getPlugin<ClientObjectManager>().getObjects();
for( Objects::const_iterator i = objects.begin(); i != objects.end(); ++i )
{
try
{
i->second->setNetworkingType( REMOTE );
}
catch ( Exception e )
{
LOGE << "Could not set object to remote: " << e.getDescription();
}
}
}
if (ch=='t' || ch=='T')
{
// Change all objects to local.
LOGI << "Setting all objects to local.";
const Objects& objects = pluginManager.getPlugin<ClientObjectManager>().getObjects();
for( Objects::const_iterator i = objects.begin(); i != objects.end(); ++i )
{
try
{
i->second->setNetworkingType( LOCAL );
}
catch ( Exception e )
{
LOGE << "Could not set object to local: " << e.getDescription();
}
}
}
if (ch=='s' || ch=='S')
{
// Change position for all objects.
LOGI << "Setting position for all position components.";
const Objects& objects = pluginManager.getPlugin<ClientObjectManager>().getObjects();
for( Objects::const_iterator i = objects.begin(); i != objects.end(); ++i )
{
/*try
{
Vector3 random = Vector3( Math::RangeRandom( -1337.0, 1337.0 ) );
camp::Value val = random;
i->second->getComponent<Position>().set( "Position",
val );
}
catch ( Exception e )
{
LOGE << "Could not set position: " << e.getDescription();
}*/
}
}
}
updateSignal();
RakSleep( 10 );
}
// Remove grid.
delete gridManager;
// Config save
if( configManager.save() )
LOGE << "Config file was not saved.";
}