Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extractor changes. #77

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions MapBuilder/FileExist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,26 @@ bool map_files_exist(const std::string& outputPath, const std::string& mapName)
return fs::exists(outputPath + "/" + mapName + ".map");
}

bool wow_exist_at_root(const std::string& rootPath) {
return fs::exists(rootPath + "/" + "WoW.exe");
}

} // namespace file_exist

namespace dir_exist {

bool output_dir_exist(const std::string& outputPath) {
return fs::exists(outputPath);
}

} // namespace dir_exist

namespace files {

void create_output_directory(const std::string& outputPath) {
fs::create_directory(outputPath);
}

void create_bvh_output_directory(const std::filesystem::path& outputPath) {
fs::create_directories(outputPath / "BVH");
}
Expand All @@ -30,4 +46,13 @@ void create_nav_output_directory_for_map(const std::filesystem::path& outputPath
fs::create_directories(outputPath / "Nav" / mapName);
}

std::vector<std::string>get_directories(const std::filesystem::path& mapsPath)
{
std::vector<std::string> r;
for (auto& p : std::filesystem::recursive_directory_iterator(mapsPath))
if (p.is_directory())
r.push_back(p.path().string());
return r;
}

} // namespace files
13 changes: 13 additions & 0 deletions MapBuilder/FileExist.hpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
#include <string>
#include <filesystem>
#include <vector>

namespace file_exist {

bool bvh_files_exist(const std::string& outputPath);

bool map_files_exist(const std::string& outputPath, const std::string& mapName);

bool wow_exist_at_root(const std::string& rootPath);

} // namespace file_exist

namespace dir_exist {

bool output_dir_exist(const std::string& rootPath);

} // namespace dir_exist

namespace files {

void create_output_directory(const std::string& rootPath);

void create_bvh_output_directory(const std::filesystem::path& outputPath);

void create_nav_output_directory(const std::filesystem::path& outputPath);

void create_nav_output_directory_for_map(const std::filesystem::path& outputPath, const std::string& mapName);

std::vector<std::string> get_directories(const std::filesystem::path& mapsPath);

} // namespace files
Loading
Loading