Region¶
- class BaseClasses.Region(name: str, player: int, multiworld: MultiWorld, hint: str | None = None)¶
Bases:
object
- class EntranceRegister(region_manager: RegionManager)¶
Bases:
Register
- class LocationRegister(region_manager: RegionManager)¶
Bases:
Register
- class Register(region_manager: RegionManager)¶
Bases:
MutableSequence
- copy()¶
- region_manager: RegionManager¶
- add_exits(exits: Iterable[str] | Dict[str, str | None], rules: Dict[str, Callable[[CollectionState], bool]] = None) List[Entrance] ¶
Connects current region to regions in exit dictionary. Passed region names must exist first.
- Parameters:
exits – exits from the region. format is {“connecting_region”: “exit_name”}. if a non dict is provided,
created entrances will be named “self.name -> connecting_region” :param rules: rules for the exits from this region. format is {“connecting_region”, rule}
- add_locations(locations: Dict[str, int | None], location_type: type[Location] | None = None) None ¶
Adds locations to the Region object, where location_type is your Location class and locations is a dict of location names to address.
- Parameters:
locations – dictionary of locations to be created and added to this Region {name: ID}
location_type – Location class to be used to create the locations with
- can_reach(state: CollectionState) bool ¶
- connect(connecting_region: Region, name: str | None = None, rule: Callable[[CollectionState], bool] | None = None) Entrance ¶
Connects this Region to another Region, placing the provided rule on the connection.
- Parameters:
connecting_region – Region object to connect to path is self -> exiting_region
name – name of the connection being created
rule – callable to determine access of this connection to go from self to the exiting_region
- create_er_target(name: str) Entrance ¶
Creates and returns an Entrance object as an entrance to this region
- Parameters:
name – name of the Entrance being created
- create_exit(name: str) Entrance ¶
Creates and returns an Entrance object as an exit of this region.
- Parameters:
name – name of the Entrance being created
- property exits¶
- get_exits()¶
- get_locations()¶
- property hint_text: str¶
- property locations¶
- multiworld: MultiWorld | None¶
- name: str¶
- player: int¶
- set_exits(new)¶
- set_locations(new)¶