本文整理汇总了C++中EntityManager::WriteEntityTreeToFile方法的典型用法代码示例。如果您正苦于以下问题:C++ EntityManager::WriteEntityTreeToFile方法的具体用法?C++ EntityManager::WriteEntityTreeToFile怎么用?C++ EntityManager::WriteEntityTreeToFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EntityManager
的用法示例。
在下文中一共展示了EntityManager::WriteEntityTreeToFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteEntityTreeToFile
void InputHandler_StageDebug::WriteEntityTreeToFile( boost::shared_ptr<CStage> pStage )
{
using namespace gregorian;
char dest_filename[512], time_str[64];
ulong current_time_ms = GlobalTimer().GetTimeMS();
if( 500 < (current_time_ms - m_EntityTreeFileLastOutputTime) ) // don't output more than once in half a second
{
EntityManager* pEntSet = pStage->GetEntitySet();
sprintf( time_str, "%.3f", (double)current_time_ms / 1000.0 );
string stage_script_name = pStage->GetScriptName();
replace_chars( stage_script_name, '/', '-' );
replace_chars( stage_script_name, '\\', '-' );
// create the directory for entity tree files (YYYYMMDD)
filesystem::path entity_tree_directory = "./debug/entity_trees-" + to_iso_string(day_clock::local_day());
boost::filesystem::create_directories( entity_tree_directory );
sprintf( dest_filename, "entity_tree-%s[%s].txt", stage_script_name.c_str(), time_str );
filesystem::path dest_filepath = entity_tree_directory / dest_filename;
// save the entity tree to disk
pEntSet->WriteEntityTreeToFile(dest_filepath.string());
m_EntityTreeFileLastOutputTime = current_time_ms;
}
}