diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-05-02 21:00:00 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-05-02 21:00:00 -0400 |
commit | 1ec273825497fd6feda19079fa8006096777b11d (patch) | |
tree | 6b705070cde43de5dbf167f636bd13428e26b3a0 /tracker_state.cpp | |
parent | a3eaefcd38f5f92dc342a2a43d37b6571d2a7a6d (diff) | |
download | lingo-ap-tracker-1ec273825497fd6feda19079fa8006096777b11d.tar.gz lingo-ap-tracker-1ec273825497fd6feda19079fa8006096777b11d.tar.bz2 lingo-ap-tracker-1ec273825497fd6feda19079fa8006096777b11d.zip |
Support door shuffle
Diffstat (limited to 'tracker_state.cpp')
-rw-r--r-- | tracker_state.cpp | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/tracker_state.cpp b/tracker_state.cpp index 62e4612..a84dd6e 100644 --- a/tracker_state.cpp +++ b/tracker_state.cpp | |||
@@ -42,26 +42,23 @@ bool IsPanelReachable_Helper(int panel_id, | |||
42 | bool IsDoorReachable_Helper(int door_id, const std::set<int>& reachable_rooms) { | 42 | bool IsDoorReachable_Helper(int door_id, const std::set<int>& reachable_rooms) { |
43 | const Door& door_obj = GetGameData().GetDoor(door_id); | 43 | const Door& door_obj = GetGameData().GetDoor(door_id); |
44 | 44 | ||
45 | switch (GetAPState().GetDoorShuffleMode()) { | 45 | if (GetAPState().GetDoorShuffleMode() == kNO_DOORS || door_obj.skip_item) { |
46 | case DoorShuffleMode::kNone: { | 46 | if (!reachable_rooms.count(door_obj.room)) { |
47 | if (!reachable_rooms.count(door_obj.room)) { | 47 | return false; |
48 | return false; | 48 | } |
49 | } | ||
50 | 49 | ||
51 | for (int panel_id : door_obj.panels) { | 50 | for (int panel_id : door_obj.panels) { |
52 | if (!IsPanelReachable_Helper(panel_id, reachable_rooms)) { | 51 | if (!IsPanelReachable_Helper(panel_id, reachable_rooms)) { |
53 | return false; | 52 | return false; |
54 | } | ||
55 | } | 53 | } |
56 | |||
57 | return true; | ||
58 | } | ||
59 | case DoorShuffleMode::kSimple: { | ||
60 | break; | ||
61 | } | ||
62 | case DoorShuffleMode::kComplex: { | ||
63 | break; | ||
64 | } | 54 | } |
55 | |||
56 | return true; | ||
57 | } else if (GetAPState().GetDoorShuffleMode() == kSIMPLE_DOORS && | ||
58 | !door_obj.group_name.empty()) { | ||
59 | return GetAPState().HasItem(door_obj.group_name); | ||
60 | } else { | ||
61 | return GetAPState().HasItem(door_obj.item_name); | ||
65 | } | 62 | } |
66 | } | 63 | } |
67 | 64 | ||
@@ -88,8 +85,7 @@ void TrackerState::CalculateState() { | |||
88 | if (room_exit.door.has_value()) { | 85 | if (room_exit.door.has_value()) { |
89 | if (IsDoorReachable_Helper(*room_exit.door, reachable_rooms)) { | 86 | if (IsDoorReachable_Helper(*room_exit.door, reachable_rooms)) { |
90 | valid_transition = true; | 87 | valid_transition = true; |
91 | } else if (GetAPState().GetDoorShuffleMode() == | 88 | } else if (GetAPState().GetDoorShuffleMode() == kNO_DOORS) { |
92 | DoorShuffleMode::kNone) { | ||
93 | new_boundary.push_back(room_exit); | 89 | new_boundary.push_back(room_exit); |
94 | } | 90 | } |
95 | } else { | 91 | } else { |