summary refs log tree commit diff stats
path: root/apworld/regions.py
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2025-08-07 16:05:15 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2025-08-07 16:05:15 -0400
commitc9da387ede51f207825b63d9f13036a7b661d4b3 (patch)
tree08425dbc57c92ac72fef43c32ecbd5805f18f1f8 /apworld/regions.py
parent3c26cedd030c464e3b8a5576a98c19eb45134658 (diff)
downloadlingo2-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.py28
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 @@
1from typing import TYPE_CHECKING
2
3from BaseClasses import Region
4from .locations import Lingo2Location
5
6if TYPE_CHECKING:
7 from . import Lingo2World
8
9
10def 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
20def 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()