diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-11-24 12:11:34 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-24 18:11:34 +0100 |
| commit | 9e57d690a3e8d337a6bbe45bec5a9449db64fd92 (patch) | |
| tree | 7ef2e05643699f561cead117b9ed845d17640f8d /static_logic.py | |
| parent | 53d71ca90b092e311310589a2654313cd569e4fe (diff) | |
| download | lingo-apworld-9e57d690a3e8d337a6bbe45bec5a9449db64fd92.tar.gz lingo-apworld-9e57d690a3e8d337a6bbe45bec5a9449db64fd92.tar.bz2 lingo-apworld-9e57d690a3e8d337a6bbe45bec5a9449db64fd92.zip | |
Lingo: Move datafiles into a subdirectory (#2459)
Diffstat (limited to 'static_logic.py')
| -rw-r--r-- | static_logic.py | 12 |
1 files changed, 7 insertions, 5 deletions
| diff --git a/static_logic.py b/static_logic.py index f6690f9..e9f82fb 100644 --- a/static_logic.py +++ b/static_logic.py | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | from typing import Dict, List, NamedTuple, Optional, Set | 1 | from typing import Dict, List, NamedTuple, Optional, Set |
| 2 | 2 | ||
| 3 | import yaml | 3 | import Utils |
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | class RoomAndDoor(NamedTuple): | 6 | class RoomAndDoor(NamedTuple): |
| @@ -108,9 +108,11 @@ def load_static_data(): | |||
| 108 | except ImportError: | 108 | except ImportError: |
| 109 | from importlib_resources import files | 109 | from importlib_resources import files |
| 110 | 110 | ||
| 111 | from . import data | ||
| 112 | |||
| 111 | # Load in all item and location IDs. These are broken up into groups based on the type of item/location. | 113 | # Load in all item and location IDs. These are broken up into groups based on the type of item/location. |
| 112 | with files("worlds.lingo").joinpath("ids.yaml").open() as file: | 114 | with files(data).joinpath("ids.yaml").open() as file: |
| 113 | config = yaml.load(file, Loader=yaml.Loader) | 115 | config = Utils.parse_yaml(file) |
| 114 | 116 | ||
| 115 | if "special_items" in config: | 117 | if "special_items" in config: |
| 116 | for item_name, item_id in config["special_items"].items(): | 118 | for item_name, item_id in config["special_items"].items(): |
| @@ -144,8 +146,8 @@ def load_static_data(): | |||
| 144 | PROGRESSIVE_ITEM_IDS[item_name] = item_id | 146 | PROGRESSIVE_ITEM_IDS[item_name] = item_id |
| 145 | 147 | ||
| 146 | # Process the main world file. | 148 | # Process the main world file. |
| 147 | with files("worlds.lingo").joinpath("LL1.yaml").open() as file: | 149 | with files(data).joinpath("LL1.yaml").open() as file: |
| 148 | config = yaml.load(file, Loader=yaml.Loader) | 150 | config = Utils.parse_yaml(file) |
| 149 | 151 | ||
| 150 | for room_name, room_data in config.items(): | 152 | for room_name, room_data in config.items(): |
| 151 | process_room(room_name, room_data) | 153 | process_room(room_name, room_data) |
