From b607eaf6bfc1940f087816acd07bcb648b2ff392 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 6 Jun 2024 16:13:47 -0400 Subject: Add sunwarp shuffle support to subway map --- src/subway_map.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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() { } } + if (AP_IsSunwarpShuffle()) { + for (const auto &[index, mapping] : AP_GetSunwarpMapping()) { + std::ostringstream tag; + tag << "sunwarp" << mapping.dots; + + SubwaySunwarp fromWarp; + if (index < 6) { + fromWarp.dots = index + 1; + fromWarp.type = SubwaySunwarpType::kEnter; + } else { + fromWarp.dots = index - 5; + fromWarp.type = SubwaySunwarpType::kExit; + } + + SubwaySunwarp toWarp; + if (mapping.exit_index < 6) { + toWarp.dots = mapping.exit_index + 1; + toWarp.type = SubwaySunwarpType::kEnter; + } else { + toWarp.dots = mapping.exit_index - 5; + toWarp.type = SubwaySunwarpType::kExit; + } + + tagged[tag.str()].push_back(GD_GetSubwayItemForSunwarp(fromWarp)); + tagged[tag.str()].push_back(GD_GetSubwayItemForSunwarp(toWarp)); + } + } + for (const auto &[tag, items] : tagged) { // Pairwise connect all items with the same tag. for (auto tag_it1 = items.begin(); std::next(tag_it1) != items.end(); -- cgit 1.4.1