diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2025-08-07 16:05:15 -0400 |
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2025-08-07 16:05:15 -0400 |
| commit | c9da387ede51f207825b63d9f13036a7b661d4b3 (patch) | |
| tree | 08425dbc57c92ac72fef43c32ecbd5805f18f1f8 /apworld/regions.py | |
| parent | 3c26cedd030c464e3b8a5576a98c19eb45134658 (diff) | |
| download | lingo2-archipelago-c9da387ede51f207825b63d9f13036a7b661d4b3.tar.gz lingo2-archipelago-c9da387ede51f207825b63d9f13036a7b661d4b3.tar.bz2 lingo2-archipelago-c9da387ede51f207825b63d9f13036a7b661d4b3.zip | |
Started apworld
vcpkg's libprotobuf is older than what PIP has, but neither are completely up to date either. Ugh. Doors have a room now because that's where the location will go.
Diffstat (limited to 'apworld/regions.py')
| -rw-r--r-- | apworld/regions.py | 28 |
1 files changed, 28 insertions, 0 deletions
| diff --git a/apworld/regions.py b/apworld/regions.py new file mode 100644 index 0000000..24c2281 --- /dev/null +++ b/apworld/regions.py | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | from typing import TYPE_CHECKING | ||
| 2 | |||
| 3 | from BaseClasses import Region | ||
| 4 | from .locations import Lingo2Location | ||
| 5 | |||
| 6 | if TYPE_CHECKING: | ||
| 7 | from . import Lingo2World | ||
| 8 | |||
| 9 | |||
| 10 | def create_region(room, world: "Lingo2World") -> Region: | ||
| 11 | new_region = Region(room.name, world.player, world.multiworld) | ||
| 12 | |||
| 13 | for location in world.player_logic.locations_by_room.get(room.id, {}): | ||
| 14 | new_location = Lingo2Location(world.player, location.name, location.code, new_region) | ||
| 15 | new_region.locations.append(new_location) | ||
| 16 | |||
| 17 | return new_region | ||
| 18 | |||
| 19 | |||
| 20 | def create_regions(world: "Lingo2World"): | ||
| 21 | regions = { | ||
| 22 | "Menu": Region("Menu", world.player, world.multiworld) | ||
| 23 | } | ||
| 24 | |||
| 25 | for room in world.static_logic.objects.rooms: | ||
| 26 | regions[room.name] = create_region(room, world) | ||
| 27 | |||
| 28 | world.multiworld.regions += regions.values() | ||
