about summary refs log tree commit diff stats
path: root/src/global.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/global.cpp')
-rw-r--r--src/global.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/global.cpp b/src/global.cpp index 3ee4f58..bd0dcaa 100644 --- a/src/global.cpp +++ b/src/global.cpp
@@ -6,6 +6,9 @@
6#include <string> 6#include <string>
7#include <string_view> 7#include <string_view>
8 8
9#include "ap_state.h"
10#include "game_data.h"
11
9const std::filesystem::path& GetExecutableDirectory() { 12const std::filesystem::path& GetExecutableDirectory() {
10 static const std::filesystem::path* executable_directory = []() { 13 static const std::filesystem::path* executable_directory = []() {
11 int length = wai_getExecutablePath(NULL, 0, NULL); 14 int length = wai_getExecutablePath(NULL, 0, NULL);
@@ -22,3 +25,16 @@ const std::filesystem::path& GetExecutableDirectory() {
22std::string GetAbsolutePath(std::string_view path) { 25std::string GetAbsolutePath(std::string_view path) {
23 return (GetExecutableDirectory() / path).string(); 26 return (GetExecutableDirectory() / path).string();
24} 27}
28
29bool IsLocationWinCondition(const Location& location) {
30 switch (AP_GetVictoryCondition()) {
31 case kTHE_END:
32 return location.ap_location_name ==
33 "Orange Tower Seventh Floor - THE END";
34 case kTHE_MASTER:
35 return location.ap_location_name ==
36 "Orange Tower Seventh Floor - THE MASTER";
37 case kLEVEL_2:
38 return location.ap_location_name == "Second Room - LEVEL 2";
39 }
40}