From 05d6cf311b8fcb18cac335a751555ea1be28bdc0 Mon Sep 17 00:00:00 2001 From: Silvris <58583688+Silvris@users.noreply.github.com> Date: Sat, 26 Aug 2023 15:29:54 -0500 Subject: [PATCH] clean imports --- worlds/kdl3/Regions.py | 14 ++++++-------- worlds/kdl3/Room.py | 4 ++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/worlds/kdl3/Regions.py b/worlds/kdl3/Regions.py index 240a26459675..bc52ea8f241f 100644 --- a/worlds/kdl3/Regions.py +++ b/worlds/kdl3/Regions.py @@ -3,15 +3,13 @@ import typing from pkgutil import get_data -from BaseClasses import Entrance, Region -from Fill import fill_restrictive +from BaseClasses import Region from worlds.AutoWorld import World -from .Locations import KDL3Location, location_table, level_consumables +from worlds.generic.Rules import add_item_rule +from .Locations import KDL3Location from .Names import LocationName -from .Names.AnimalFriendSpawns import animal_friend_spawns from .Options import BossShuffle from .Room import Room -from ..generic.Rules import add_item_rule, add_rule if typing.TYPE_CHECKING: from . import KDL3World @@ -39,7 +37,7 @@ def generate_valid_level(level, stage, possible_stages, slot_random): return new_stage -def generate_rooms(world: World, door_shuffle: bool, level_regions: typing.Dict[int, Region]): +def generate_rooms(world: "KDL3World", door_shuffle: bool, level_regions: typing.Dict[int, Region]): level_names = {LocationName.level_names[level]: level for level in LocationName.level_names} room_data = json.loads(get_data(__name__, os.path.join("data", "Rooms.json"))) rooms: typing.Dict[str, Room] = dict() @@ -100,7 +98,7 @@ def generate_rooms(world: World, door_shuffle: bool, level_regions: typing.Dict[ level_regions[level].add_exits([first_rooms[0x770200 + level - 1].name]) -def generate_valid_levels(world: World, enforce_world: bool, enforce_pattern: bool) -> dict: +def generate_valid_levels(world: "KDL3World", enforce_world: bool, enforce_pattern: bool) -> dict: levels: typing.Dict[int, typing.List[typing.Optional[int]]] = { 1: [None for _ in range(7)], 2: [None for _ in range(7)], @@ -193,7 +191,7 @@ def generate_valid_levels(world: World, enforce_world: bool, enforce_pattern: bo return levels -def create_levels(world: World) -> None: +def create_levels(world: "KDL3World") -> None: menu = Region("Menu", world.player, world.multiworld) level1 = Region("Grass Land", world.player, world.multiworld) level2 = Region("Ripple Field", world.player, world.multiworld) diff --git a/worlds/kdl3/Room.py b/worlds/kdl3/Room.py index e7488a43cf2a..62a242797baf 100644 --- a/worlds/kdl3/Room.py +++ b/worlds/kdl3/Room.py @@ -1,7 +1,7 @@ import struct import typing -from BaseClasses import CollectionState, Region, ItemClassification -from struct import unpack + +from BaseClasses import Region, ItemClassification if typing.TYPE_CHECKING: from .Rom import RomData