diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2025-09-16 16:59:51 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2025-09-16 16:59:51 -0400 |
commit | 462a547f78080fbd371c318945352bf9a08001bb (patch) | |
tree | 8ce02c0234461a4b73e45245f02e1a9870239875 /apworld/player_logic.py | |
parent | b2b87691af2b9bba227735152abc2d983ed938ab (diff) | |
download | lingo2-archipelago-462a547f78080fbd371c318945352bf9a08001bb.tar.gz lingo2-archipelago-462a547f78080fbd371c318945352bf9a08001bb.tar.bz2 lingo2-archipelago-462a547f78080fbd371c318945352bf9a08001bb.zip |
[Apworld] Fix indirect conditions for deep reqs
Diffstat (limited to 'apworld/player_logic.py')
-rw-r--r-- | apworld/player_logic.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/apworld/player_logic.py b/apworld/player_logic.py index ce6ae24..4aa481d 100644 --- a/apworld/player_logic.py +++ b/apworld/player_logic.py | |||
@@ -144,6 +144,29 @@ class AccessRequirements: | |||
144 | if resimplify: | 144 | if resimplify: |
145 | self.simplify() | 145 | self.simplify() |
146 | 146 | ||
147 | def get_referenced_rooms(self): | ||
148 | result = set(self.rooms) | ||
149 | |||
150 | for disjunction in self.or_logic: | ||
151 | for sub_req in disjunction: | ||
152 | result = result.union(sub_req.get_referenced_rooms()) | ||
153 | |||
154 | for sub_req in self.possibilities: | ||
155 | result = result.union(sub_req.get_referenced_rooms()) | ||
156 | |||
157 | return result | ||
158 | |||
159 | def remove_room(self, room: str): | ||
160 | if room in self.rooms: | ||
161 | self.rooms.remove(room) | ||
162 | |||
163 | for disjunction in self.or_logic: | ||
164 | for sub_req in disjunction: | ||
165 | sub_req.remove_room(room) | ||
166 | |||
167 | for sub_req in self.possibilities: | ||
168 | sub_req.remove_room(room) | ||
169 | |||
147 | def __repr__(self): | 170 | def __repr__(self): |
148 | parts = [] | 171 | parts = [] |
149 | if len(self.items) > 0: | 172 | if len(self.items) > 0: |