From ca521f44faf55c957de6e0a5d2567fc53f59fc28 Mon Sep 17 00:00:00 2001 From: Nicholas Saylor Date: Sat, 30 Nov 2024 13:01:23 -0500 Subject: [PATCH 1/5] Simplify datatypes import --- worlds/lingo/player_logic.py | 4 ++-- worlds/lingo/utils/pickle_static_data.py | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/worlds/lingo/player_logic.py b/worlds/lingo/player_logic.py index b21735c1f533..83217d7311a3 100644 --- a/worlds/lingo/player_logic.py +++ b/worlds/lingo/player_logic.py @@ -412,7 +412,7 @@ def randomize_paintings(self, world: "LingoWorld") -> bool: required_painting_rooms += REQUIRED_PAINTING_WHEN_NO_DOORS_ROOMS req_exits = [painting_id for painting_id, painting in PAINTINGS.items() if painting.required_when_no_doors] - def is_req_enterable(painting_id: str, painting: Painting) -> bool: + def is_req_enterable(painting: Painting) -> bool: if painting.exit_only or painting.disable or painting.req_blocked\ or painting.room in required_painting_rooms: return False @@ -433,7 +433,7 @@ def is_req_enterable(painting_id: str, painting: Painting) -> bool: return True req_enterable = [painting_id for painting_id, painting in PAINTINGS.items() - if is_req_enterable(painting_id, painting)] + if is_req_enterable(painting)] req_exits += [painting_id for painting_id, painting in PAINTINGS.items() if painting.exit_only and painting.required] req_entrances = world.random.sample(req_enterable, len(req_exits)) diff --git a/worlds/lingo/utils/pickle_static_data.py b/worlds/lingo/utils/pickle_static_data.py index 92bcb7a859ea..72eb9c9cd19e 100644 --- a/worlds/lingo/utils/pickle_static_data.py +++ b/worlds/lingo/utils/pickle_static_data.py @@ -1,12 +1,7 @@ from typing import Dict, List, Set, Optional import os -import sys - -sys.path.append(os.path.join("worlds", "lingo")) -sys.path.append(".") -sys.path.append("..") -from datatypes import Door, DoorType, EntranceType, Painting, Panel, PanelDoor, Progression, Room, RoomAndDoor,\ +from ..datatypes import Door, DoorType, EntranceType, Painting, Panel, PanelDoor, Progression, Room, RoomAndDoor, \ RoomAndPanel, RoomAndPanelDoor, RoomEntrance import hashlib From 59e115575d0dea2df0a33bb1fb08fc62625bc44c Mon Sep 17 00:00:00 2001 From: Nicholas Saylor Date: Sat, 30 Nov 2024 13:02:49 -0500 Subject: [PATCH 2/5] Revert "Simplify datatypes import" This reverts commit ca521f44faf55c957de6e0a5d2567fc53f59fc28. --- worlds/lingo/player_logic.py | 4 ++-- worlds/lingo/utils/pickle_static_data.py | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/worlds/lingo/player_logic.py b/worlds/lingo/player_logic.py index 83217d7311a3..b21735c1f533 100644 --- a/worlds/lingo/player_logic.py +++ b/worlds/lingo/player_logic.py @@ -412,7 +412,7 @@ def randomize_paintings(self, world: "LingoWorld") -> bool: required_painting_rooms += REQUIRED_PAINTING_WHEN_NO_DOORS_ROOMS req_exits = [painting_id for painting_id, painting in PAINTINGS.items() if painting.required_when_no_doors] - def is_req_enterable(painting: Painting) -> bool: + def is_req_enterable(painting_id: str, painting: Painting) -> bool: if painting.exit_only or painting.disable or painting.req_blocked\ or painting.room in required_painting_rooms: return False @@ -433,7 +433,7 @@ def is_req_enterable(painting: Painting) -> bool: return True req_enterable = [painting_id for painting_id, painting in PAINTINGS.items() - if is_req_enterable(painting)] + if is_req_enterable(painting_id, painting)] req_exits += [painting_id for painting_id, painting in PAINTINGS.items() if painting.exit_only and painting.required] req_entrances = world.random.sample(req_enterable, len(req_exits)) diff --git a/worlds/lingo/utils/pickle_static_data.py b/worlds/lingo/utils/pickle_static_data.py index 72eb9c9cd19e..92bcb7a859ea 100644 --- a/worlds/lingo/utils/pickle_static_data.py +++ b/worlds/lingo/utils/pickle_static_data.py @@ -1,7 +1,12 @@ from typing import Dict, List, Set, Optional import os -from ..datatypes import Door, DoorType, EntranceType, Painting, Panel, PanelDoor, Progression, Room, RoomAndDoor, \ +import sys + +sys.path.append(os.path.join("worlds", "lingo")) +sys.path.append(".") +sys.path.append("..") +from datatypes import Door, DoorType, EntranceType, Painting, Panel, PanelDoor, Progression, Room, RoomAndDoor,\ RoomAndPanel, RoomAndPanelDoor, RoomEntrance import hashlib From cc78f11681a03fdf09aecd793423d14a2f67b729 Mon Sep 17 00:00:00 2001 From: Nicholas Saylor Date: Sat, 30 Nov 2024 13:04:07 -0500 Subject: [PATCH 3/5] Simplify datatypes import --- worlds/lingo/player_logic.py | 4 ++-- worlds/lingo/utils/pickle_static_data.py | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/worlds/lingo/player_logic.py b/worlds/lingo/player_logic.py index b21735c1f533..83217d7311a3 100644 --- a/worlds/lingo/player_logic.py +++ b/worlds/lingo/player_logic.py @@ -412,7 +412,7 @@ def randomize_paintings(self, world: "LingoWorld") -> bool: required_painting_rooms += REQUIRED_PAINTING_WHEN_NO_DOORS_ROOMS req_exits = [painting_id for painting_id, painting in PAINTINGS.items() if painting.required_when_no_doors] - def is_req_enterable(painting_id: str, painting: Painting) -> bool: + def is_req_enterable(painting: Painting) -> bool: if painting.exit_only or painting.disable or painting.req_blocked\ or painting.room in required_painting_rooms: return False @@ -433,7 +433,7 @@ def is_req_enterable(painting_id: str, painting: Painting) -> bool: return True req_enterable = [painting_id for painting_id, painting in PAINTINGS.items() - if is_req_enterable(painting_id, painting)] + if is_req_enterable(painting)] req_exits += [painting_id for painting_id, painting in PAINTINGS.items() if painting.exit_only and painting.required] req_entrances = world.random.sample(req_enterable, len(req_exits)) diff --git a/worlds/lingo/utils/pickle_static_data.py b/worlds/lingo/utils/pickle_static_data.py index 92bcb7a859ea..57142ebeaa34 100644 --- a/worlds/lingo/utils/pickle_static_data.py +++ b/worlds/lingo/utils/pickle_static_data.py @@ -1,12 +1,7 @@ from typing import Dict, List, Set, Optional import os -import sys - -sys.path.append(os.path.join("worlds", "lingo")) -sys.path.append(".") -sys.path.append("..") -from datatypes import Door, DoorType, EntranceType, Painting, Panel, PanelDoor, Progression, Room, RoomAndDoor,\ +from ..datatypes import Door, DoorType, EntranceType, Painting, Panel, PanelDoor, Progression, Room, RoomAndDoor, =\ RoomAndPanel, RoomAndPanelDoor, RoomEntrance import hashlib From 8e80cd58d787bf48d251c4216e508bda8bb109f1 Mon Sep 17 00:00:00 2001 From: Nicholas Saylor <79181893+nicholassaylor@users.noreply.github.com> Date: Sat, 30 Nov 2024 13:07:26 -0500 Subject: [PATCH 4/5] Don't know how that made it in there --- worlds/lingo/utils/pickle_static_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worlds/lingo/utils/pickle_static_data.py b/worlds/lingo/utils/pickle_static_data.py index 57142ebeaa34..72eb9c9cd19e 100644 --- a/worlds/lingo/utils/pickle_static_data.py +++ b/worlds/lingo/utils/pickle_static_data.py @@ -1,7 +1,7 @@ from typing import Dict, List, Set, Optional import os -from ..datatypes import Door, DoorType, EntranceType, Painting, Panel, PanelDoor, Progression, Room, RoomAndDoor, =\ +from ..datatypes import Door, DoorType, EntranceType, Painting, Panel, PanelDoor, Progression, Room, RoomAndDoor, \ RoomAndPanel, RoomAndPanelDoor, RoomEntrance import hashlib From e287788aef0a113acfaf5aff4e0069d42448b8db Mon Sep 17 00:00:00 2001 From: Nicholas Saylor Date: Sun, 1 Dec 2024 12:06:07 -0500 Subject: [PATCH 5/5] Revert datatypes change --- worlds/lingo/utils/pickle_static_data.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/worlds/lingo/utils/pickle_static_data.py b/worlds/lingo/utils/pickle_static_data.py index 72eb9c9cd19e..cd5c4b41df4b 100644 --- a/worlds/lingo/utils/pickle_static_data.py +++ b/worlds/lingo/utils/pickle_static_data.py @@ -1,12 +1,16 @@ from typing import Dict, List, Set, Optional import os -from ..datatypes import Door, DoorType, EntranceType, Painting, Panel, PanelDoor, Progression, Room, RoomAndDoor, \ +import sys + +sys.path.append(os.path.join("worlds", "lingo")) +sys.path.append(".") +sys.path.append("..") +from datatypes import Door, DoorType, EntranceType, Painting, Panel, PanelDoor, Progression, Room, RoomAndDoor,\ RoomAndPanel, RoomAndPanelDoor, RoomEntrance import hashlib import pickle -import sys import Utils