def create_from_game( cls, game: GameDescription, player_index: int, configuration: BaseConfiguration, ) -> GamePatches: game.world_list.ensure_has_node_cache() return GamePatches( game, player_index, configuration, pickup_assignment={}, elevator_connection=game.get_default_elevator_connection(), dock_connection=[None] * len(game.world_list.all_nodes), dock_weakness=[None] * len(game.world_list.all_nodes), configurable_nodes={}, starting_items=ResourceCollection.with_database( game.resource_database), starting_location=game.starting_location, hints={}, )
def create_base_patches(self, configuration: BaseConfiguration, rng: Random, game: GameDescription, is_multiworld: bool, player_index: int, rng_required: bool = True ) -> GamePatches: """ """ patches = GamePatches(player_index, configuration, {}, game.get_default_elevator_connection(), {}, {}, {}, {}, game.starting_location, {}) # Elevators try: patches = self.add_elevator_connections_to_patches(configuration, rng, patches) except MissingRng as e: if rng_required: raise e # Configurable Nodes try: patches = patches.assign_node_configuration( self.configurable_node_assignment(configuration, game, rng) ) except MissingRng as e: if rng_required: raise e # Starting Location try: patches = patches.assign_starting_location( self.starting_location_for_configuration(configuration, game, rng)) except MissingRng as e: if rng_required: raise e return patches