QString Customizations::DataBasePath() { static bool cached = false; if ( cached ) return dataBasePath_; QList<QString> checked_paths; QString sub_path( "lobby/SpringLobby/customizations/" ); sub_path.append( m_shortname ); for ( int i = 0; i < susynclib().GetSpringDataDirCount(); ++i ) { QDir data ( ToQString( susynclib().GetSpringDataDirByIndex(i) ) ); checked_paths.append( data.absolutePath().append("/").append( sub_path ) ); if ( data.cd( sub_path ) ) { dataBasePath_ = data.absolutePath(); break; } } if( dataBasePath_ != QString() ) return dataBasePath_ ; checked_paths.prepend( QString("Couldn't find customization data in any of these directories:\n ") ); throw DataException( checked_paths ); return QString(); }
void WaypointMovementGenerator<Creature>::MoveToNextNode(CreatureTraveller &traveller) { Creature* owner = &(traveller.i_traveller); i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z, false); PathInfo sub_path(owner, node->x, node->y, node->z); PointPath pointPath = sub_path.getFullPath(); float speed = traveller.Speed()*0.001f; // in ms uint32 traveltime = uint32(pointPath.GetTotalLength()/speed); owner->SendMonsterMoveByPath(pointPath, 1, pointPath.size(), traveltime); i_nextMoveTime.Reset(traveltime); }
void WaypointMovementGenerator<Creature>::MoveToNextNode(CreatureTraveller &traveller) { Creature* owner = &(traveller.i_traveller); const WaypointNode &node = i_path->at(i_currentNode); i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z, false); PathInfo sub_path(owner, node.x, node.y, node.z); PointPath myPath = sub_path.getFullPath(); float speed = traveller.Speed()*0.001f; // in ms uint32 traveltime = uint32(myPath.GetTotalLength()/speed); owner->SendMonsterMoveByPath(myPath, 1, myPath.size(), owner->GetSplineFlags(), traveltime); i_nextMoveTime.Reset(traveltime); }
std::string FindProjectIncludeDirectory::get_editor_include_directory() { std::string editor_include(""); if (m_engine_directory.empty()) { return editor_include; } std::string indent = " \""; std::string end_indent = "\",\n"; boost::filesystem::path editor_runtime_path(m_engine_directory); editor_runtime_path += "\\Engine\\Source\\Editor"; for (boost::filesystem::directory_entry &dir_entry: boost::filesystem::directory_iterator(editor_runtime_path)) { boost::filesystem::path single_path(dir_entry.path()); single_path += "\\Public"; if (boost::filesystem::is_directory(single_path)) { editor_include += indent; editor_include += single_path.string(); editor_include += end_indent; for (boost::filesystem::directory_entry &temp_entry: boost::filesystem::directory_iterator(single_path)) { boost::filesystem::path sub_path(temp_entry.path()); if (!boost::filesystem::is_directory(sub_path)) { continue; } editor_include += indent; editor_include += sub_path.string(); editor_include += end_indent; } } boost::filesystem::path single_path2(dir_entry.path()); single_path2 += "\\Classes"; if (boost::filesystem::is_directory(single_path2)) { editor_include += indent; editor_include += single_path2.string(); editor_include += end_indent; } } return editor_include; }
std::string FindProjectIncludeDirectory::get_engine_include_directory() { std::string engine_include(""); if (m_engine_directory.empty()) { return engine_include; } std::string indent = " \""; std::string end_indent = "\",\n"; // find engine runtime library directory from engine root directory boost::filesystem::path engine_runtime_path(m_engine_directory); engine_runtime_path += "\\Engine\\Source\\RunTime"; for (boost::filesystem::directory_entry &dir_entry: boost::filesystem::directory_iterator(engine_runtime_path)) { boost::filesystem::path single_path(dir_entry.path()); single_path += "\\Public"; if (boost::filesystem::is_directory(single_path)) { engine_include += indent; engine_include += single_path.string(); engine_include += end_indent; for (auto &dir_entry : boost::filesystem::directory_iterator(single_path)) { boost::filesystem::path sub_path(dir_entry.path()); if (boost::filesystem::is_directory(sub_path)) { engine_include += indent; engine_include += sub_path.string(); engine_include += end_indent; } } } boost::filesystem::path single_path2(dir_entry.path()); single_path2 += "\\Classes"; if (boost::filesystem::is_directory(single_path2)) { engine_include += indent; engine_include += single_path2.string(); engine_include += end_indent; } } return engine_include; }