blob: 24c2281bddab51244d43936905046d3d740025bb (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
from typing import TYPE_CHECKING
from BaseClasses import Region
from .locations import Lingo2Location
if TYPE_CHECKING:
from . import Lingo2World
def create_region(room, world: "Lingo2World") -> Region:
new_region = Region(room.name, world.player, world.multiworld)
for location in world.player_logic.locations_by_room.get(room.id, {}):
new_location = Lingo2Location(world.player, location.name, location.code, new_region)
new_region.locations.append(new_location)
return new_region
def create_regions(world: "Lingo2World"):
regions = {
"Menu": Region("Menu", world.player, world.multiworld)
}
for room in world.static_logic.objects.rooms:
regions[room.name] = create_region(room, world)
world.multiworld.regions += regions.values()
|