diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-02-18 09:38:08 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-02-18 09:38:08 -0500 |
commit | cf3fc6cbcb9ad00f4b99502344431bef469cec8d (patch) | |
tree | fb803654f6aa432a495b820647931e6d79cebaf7 /src/global.cpp | |
parent | 7cb55acb62c5a03df75edd0c3c8f228295c1bee8 (diff) | |
download | lingo-ap-tracker-cf3fc6cbcb9ad00f4b99502344431bef469cec8d.tar.gz lingo-ap-tracker-cf3fc6cbcb9ad00f4b99502344431bef469cec8d.tar.bz2 lingo-ap-tracker-cf3fc6cbcb9ad00f4b99502344431bef469cec8d.zip |
Make win condition checkable
Diffstat (limited to 'src/global.cpp')
-rw-r--r-- | src/global.cpp | 16 |
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 | |||
9 | const std::filesystem::path& GetExecutableDirectory() { | 12 | const 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() { | |||
22 | std::string GetAbsolutePath(std::string_view path) { | 25 | std::string GetAbsolutePath(std::string_view path) { |
23 | return (GetExecutableDirectory() / path).string(); | 26 | return (GetExecutableDirectory() / path).string(); |
24 | } | 27 | } |
28 | |||
29 | bool 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 | } | ||