core: rip out RegionType and rework Region class (#814)

This commit is contained in:
alwaysintreble
2023-02-13 18:06:43 -06:00
committed by GitHub
parent f7a0542898
commit 7cbeb8438b
48 changed files with 1324 additions and 937 deletions

View File

@@ -17,7 +17,7 @@ from .ExtractedData import locations, starts, multi_locations, location_to_regio
event_names, item_effects, connectors, one_ways, vanilla_shop_costs, vanilla_location_costs
from .Charms import names as charm_names
from BaseClasses import Region, Entrance, Location, MultiWorld, Item, RegionType, LocationProgressType, Tutorial, ItemClassification
from BaseClasses import Region, Entrance, Location, MultiWorld, Item, LocationProgressType, Tutorial, ItemClassification
from ..AutoWorld import World, LogicMixin, WebWorld
path_of_pain_locations = {
@@ -585,17 +585,13 @@ class HKWorld(World):
return self.multiworld.random.choice(self.cached_filler_items[self.player])
def create_region(world: MultiWorld, player: int, name: str, location_names=None, exits=None) -> Region:
ret = Region(name, RegionType.Generic, name, player)
ret.multiworld = world
def create_region(world: MultiWorld, player: int, name: str, location_names=None) -> Region:
ret = Region(name, player, world)
if location_names:
for location in location_names:
loc_id = HKWorld.location_name_to_id.get(location, None)
location = HKLocation(player, location, loc_id, ret)
ret.locations.append(location)
if exits:
for exit in exits:
ret.exits.append(Entrance(player, exit, ret))
return ret