3
3
import json
4
4
5
5
from BaseClasses import MultiWorld , Item , Location
6
- from typing import Optional , List
6
+ from typing import Optional , List , TYPE_CHECKING
7
7
from worlds .AutoWorld import World
8
8
from .hooks .Helpers import before_is_category_enabled , before_is_item_enabled , before_is_location_enabled
9
9
10
10
from typing import Union
11
11
12
+ if TYPE_CHECKING :
13
+ from .Items import ManualItem
14
+ from .Locations import ManualLocation
15
+
12
16
# blatantly copied from the minecraft ap world because why not
13
17
def load_data_file (* args ) -> dict :
14
18
fname = os .path .join ("data" , * args )
@@ -69,7 +73,7 @@ def is_item_name_enabled(multiworld: MultiWorld, player: int, item_name: str) ->
69
73
70
74
return is_item_enabled (multiworld , player , item )
71
75
72
- def is_item_enabled (multiworld : MultiWorld , player : int , item : Item ) -> bool :
76
+ def is_item_enabled (multiworld : MultiWorld , player : int , item : "ManualItem" ) -> bool :
73
77
"""Check if an item has been disabled by a yaml option."""
74
78
hook_result = before_is_item_enabled (multiworld , player , item )
75
79
if hook_result is not None :
@@ -85,7 +89,7 @@ def is_location_name_enabled(multiworld: MultiWorld, player: int, location_name:
85
89
86
90
return is_location_enabled (multiworld , player , location )
87
91
88
- def is_location_enabled (multiworld : MultiWorld , player : int , location : Location ) -> bool :
92
+ def is_location_enabled (multiworld : MultiWorld , player : int , location : "ManualLocation" ) -> bool :
89
93
"""Check if a location has been disabled by a yaml option."""
90
94
hook_result = before_is_location_enabled (multiworld , player , location )
91
95
if hook_result is not None :
0 commit comments