about summary refs log tree commit diff stats
path: root/src/global.cpp
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-02-18 09:38:08 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2024-02-18 09:38:08 -0500
commitcf3fc6cbcb9ad00f4b99502344431bef469cec8d (patch)
treefb803654f6aa432a495b820647931e6d79cebaf7 /src/global.cpp
parent7cb55acb62c5a03df75edd0c3c8f228295c1bee8 (diff)
downloadlingo-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.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}