def move(self): """ Initiates move. """ from game_state import GameState # Load destinations for the current location from the current GAME_MAP destinations = GameState.GAME_MAP.get_destinations_for_location(self.tag) # Display list box for the possible destinations selection = ui.list_box("Move to...", destinations) # If selection is None then we go back if not selection: return # Updates the current location in the GameState GameState.update_current_location(selection) GameState.CURRENT_LOCATION.start()
def test_update_current_location(self): escript = TestGameState.initialize_game_with_test_escript() GameState.update_current_location('car') self.assertEqual(GameState.CURRENT_LOCATION.tag, 'car')