summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorNicholas Saylor <79181893+nicholassaylor@users.noreply.github.com>2024-12-02 21:02:18 -0500
committerGitHub <noreply@github.com>2024-12-03 03:02:18 +0100
commitac7540d019cefc72dd6206277cb02fe794a49ab6 (patch)
tree1885864ff03d51a4ac14ea2d21fdb8a431414147
parent27eccb95d00399621ed78c78f49c5d76bd868501 (diff)
downloadlingo-apworld-ac7540d019cefc72dd6206277cb02fe794a49ab6.tar.gz
lingo-apworld-ac7540d019cefc72dd6206277cb02fe794a49ab6.tar.bz2
lingo-apworld-ac7540d019cefc72dd6206277cb02fe794a49ab6.zip
Lingo: Optimize imports and remove unused parameter (#4305)
-rw-r--r--player_logic.py4
-rw-r--r--utils/pickle_static_data.py1
2 files changed, 2 insertions, 3 deletions
diff --git a/player_logic.py b/player_logic.py index b21735c..83217d7 100644 --- a/player_logic.py +++ b/player_logic.py
@@ -412,7 +412,7 @@ class LingoPlayerLogic:
412 required_painting_rooms += REQUIRED_PAINTING_WHEN_NO_DOORS_ROOMS 412 required_painting_rooms += REQUIRED_PAINTING_WHEN_NO_DOORS_ROOMS
413 req_exits = [painting_id for painting_id, painting in PAINTINGS.items() if painting.required_when_no_doors] 413 req_exits = [painting_id for painting_id, painting in PAINTINGS.items() if painting.required_when_no_doors]
414 414
415 def is_req_enterable(painting_id: str, painting: Painting) -> bool: 415 def is_req_enterable(painting: Painting) -> bool:
416 if painting.exit_only or painting.disable or painting.req_blocked\ 416 if painting.exit_only or painting.disable or painting.req_blocked\
417 or painting.room in required_painting_rooms: 417 or painting.room in required_painting_rooms:
418 return False 418 return False
@@ -433,7 +433,7 @@ class LingoPlayerLogic:
433 return True 433 return True
434 434
435 req_enterable = [painting_id for painting_id, painting in PAINTINGS.items() 435 req_enterable = [painting_id for painting_id, painting in PAINTINGS.items()
436 if is_req_enterable(painting_id, painting)] 436 if is_req_enterable(painting)]
437 req_exits += [painting_id for painting_id, painting in PAINTINGS.items() 437 req_exits += [painting_id for painting_id, painting in PAINTINGS.items()
438 if painting.exit_only and painting.required] 438 if painting.exit_only and painting.required]
439 req_entrances = world.random.sample(req_enterable, len(req_exits)) 439 req_entrances = world.random.sample(req_enterable, len(req_exits))
diff --git a/utils/pickle_static_data.py b/utils/pickle_static_data.py index 92bcb7a..cd5c4b4 100644 --- a/utils/pickle_static_data.py +++ b/utils/pickle_static_data.py
@@ -11,7 +11,6 @@ from datatypes import Door, DoorType, EntranceType, Painting, Panel, PanelDoor,
11 11
12import hashlib 12import hashlib
13import pickle 13import pickle
14import sys
15import Utils 14import Utils
16 15
17 16