about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-06-06 16:13:47 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2024-06-06 16:13:47 -0400
commitb607eaf6bfc1940f087816acd07bcb648b2ff392 (patch)
tree3e403e0b3c7356a80993247588937c20f1bb1da2 /src
parent16a7c3ab4beb3f834bc37c786440e729548495c8 (diff)
downloadlingo-ap-tracker-0.10.0.tar.gz
lingo-ap-tracker-0.10.0.tar.bz2
lingo-ap-tracker-0.10.0.zip
Add sunwarp shuffle support to subway map v0.10.0
Diffstat (limited to 'src')
-rw-r--r--src/subway_map.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/subway_map.cpp b/src/subway_map.cpp index 8364714..408c4f0 100644 --- a/src/subway_map.cpp +++ b/src/subway_map.cpp
@@ -98,6 +98,34 @@ void SubwayMap::OnConnect() {
98 } 98 }
99 } 99 }
100 100
101 if (AP_IsSunwarpShuffle()) {
102 for (const auto &[index, mapping] : AP_GetSunwarpMapping()) {
103 std::ostringstream tag;
104 tag << "sunwarp" << mapping.dots;
105
106 SubwaySunwarp fromWarp;
107 if (index < 6) {
108 fromWarp.dots = index + 1;
109 fromWarp.type = SubwaySunwarpType::kEnter;
110 } else {
111 fromWarp.dots = index - 5;
112 fromWarp.type = SubwaySunwarpType::kExit;
113 }
114
115 SubwaySunwarp toWarp;
116 if (mapping.exit_index < 6) {
117 toWarp.dots = mapping.exit_index + 1;
118 toWarp.type = SubwaySunwarpType::kEnter;
119 } else {
120 toWarp.dots = mapping.exit_index - 5;
121 toWarp.type = SubwaySunwarpType::kExit;
122 }
123
124 tagged[tag.str()].push_back(GD_GetSubwayItemForSunwarp(fromWarp));
125 tagged[tag.str()].push_back(GD_GetSubwayItemForSunwarp(toWarp));
126 }
127 }
128
101 for (const auto &[tag, items] : tagged) { 129 for (const auto &[tag, items] : tagged) {
102 // Pairwise connect all items with the same tag. 130 // Pairwise connect all items with the same tag.
103 for (auto tag_it1 = items.begin(); std::next(tag_it1) != items.end(); 131 for (auto tag_it1 = items.begin(); std::next(tag_it1) != items.end();