Performance optimizations

This commit is contained in:
aerinon
2021-08-03 09:26:41 -06:00
parent aeb910e274
commit 24b01cfcc7
5 changed files with 64 additions and 46 deletions

View File

@@ -434,8 +434,12 @@ class World(object):
def can_beat_game(self, starting_state=None):
if starting_state:
if self.has_beaten_game(starting_state):
return True
state = starting_state.copy()
else:
if self.has_beaten_game(self.state):
return True
state = CollectionState(self)
if self.has_beaten_game(state):