Пример #1
0
def launch():
    if test_constants.UNITTEST_TEST_INTENTS:
        return ReplyHelpers.reply('launchIntent')

    user_id = session.user.userId
    if game_manager.is_game_started(user_id):
        return __continue_game()

    welcome_text = ReplyHelpers.render_common_template('welcome')
    #help_text = ReplyHelpers.render_common_template('help')

    #Look for saved games
    gm = LoadManager(user_id)
    if not gm.does_user_game_exist('test'):
        games_text = ReplyHelpers.render_common_template(
            'no_games') + ' ' + ReplyHelpers.render_common_template(
                'choose_class')
        return __query(welcome_text + ' ' + games_text,
                       query_state=ReplyHelpers.QUERY_CLASS)
    else:
        games_text = ReplyHelpers.render_common_template('load_game')
        #If only one game load it
        game_manager.load_game(user_id, 'test')
        return __continue_game()
Пример #2
0
def reply_current_intent():
    return ReplyHelpers.reply(ask.request.intent.name)