Exemple #1
0
        public PointsDialog(MathBotRecognizer luisRecognizer)
            : base(nameof(PointsDialog))
        {
            _luisRecognizer = luisRecognizer;
            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                QuestionAsync,
                AnswerAsync,
                EndGameAsync,
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Exemple #2
0
        public CasualDialog(MathBotRecognizer luisRecognizer)
            : base(nameof(CasualDialog))
        {
            questionNr      = 0;
            points          = 0;
            _luisRecognizer = luisRecognizer;
            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                QuestionAsync,
                AnswerAsync,
                CheckEndConditionAsync,
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Exemple #3
0
        public GameDialog(MathBotRecognizer luisRecognizer, CasualDialog casualDialog, PointsDialog pointsDialog, TimeDialog timeDialog)
            : base(nameof(GameDialog))
        {
            _luisRecognizer = luisRecognizer;
            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(pointsDialog);
            AddDialog(casualDialog);
            AddDialog(timeDialog);
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                GameStepAsync,
                EndGameAsync,
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Exemple #4
0
        public TimeDialog(MathBotRecognizer luisRecognizer)
            : base(nameof(TimeDialog))
        {
            _luisRecognizer = luisRecognizer;
            AddDialog(new TextPrompt(nameof(TextPrompt)));

            aTimer.Elapsed += new ElapsedEventHandler(endGame);

            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                QuestionAsync,
                AnswerAsync,
                EndGameAsync,
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Exemple #5
0
        // Dependency injection uses this constructor to instantiate MainDialog
        public MainDialog(MathBotRecognizer luisRecognizer, GameDialog gameDialog, ILogger <MainDialog> logger)
            : base(nameof(MainDialog))
        {
            _luisRecognizer = luisRecognizer;
            Logger          = logger;

            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(gameDialog);
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                IntroStepAsync,
                GreetingStepAsync,
                GameChoiceStepAsync,
                HandleResponseAsync,
                FinalStepAsync,
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }