#include "global.h" #include #include #include #include #include "ap_state.h" #include "game_data.h" const std::filesystem::path& GetExecutableDirectory() { static const std::filesystem::path* executable_directory = []() { int length = wai_getExecutablePath(NULL, 0, NULL); std::string buf(length, 0); wai_getExecutablePath(buf.data(), length, NULL); std::filesystem::path exec_path(buf); return new std::filesystem::path(exec_path.parent_path()); }(); return *executable_directory; } std::string GetAbsolutePath(std::string_view path) { return (GetExecutableDirectory() / path).string(); } std::string GetWinCondition() { switch (AP_GetVictoryCondition()) { case kTHE_END: return "Orange Tower Seventh Floor - THE END"; case kTHE_MASTER: return "Orange Tower Seventh Floor - THE MASTER"; case kLEVEL_2: return "Second Room - LEVEL 2"; case kPILGRIMAGE: return "Pilgrim Antechamber - PILGRIM"; } } bool IsLocationWinCondition(const Location& location) { return location.ap_location_name == GetWinCondition(); }