Example #1
0
        private void ScheduleAutomatedActions(IChatClient chatClient)
        {
            _lastCallToJoin = new DelayedMessageAction(HEIST_DELAY_IN_SECONDS - 30,
                                                       "Only 30 seconds left to join the heist! Type !heist to join it!", chatClient);
            _automatedActionSystem.AddAction(_lastCallToJoin);

            _startHeistAction = new OneTimeCallBackAction(HEIST_DELAY_IN_SECONDS, () => StartHeist(chatClient));
            _automatedActionSystem.AddAction(_startHeistAction);
        }
Example #2
0
        private void CreateGameJoinWindow(IChatClient chatClient)
        {
            var joinWarning = new DelayedMessageAction(30, "You only have 30 seconds left to join the quiz game! Type \"!quiz join\" to join the game!", chatClient);

            _automatedActionSystem.AddAction(joinWarning);

            var startAskingQuestions = new OneTimeCallBackAction(60, () => StartAskingQuestions(chatClient));

            _automatedActionSystem.AddAction(startAskingQuestions);
        }
Example #3
0
        private void StartAskingQuestions(IChatClient chatClient)
        {
            _questionAskingStarted = true;

            chatClient.SendMessage($"Starting the quiz now! Our competitors are: {string.Join(", ", CurrentPlayers.Keys)}");

            QuizQuestion randomQuestion = GetRandomQuestion();

            chatClient.SendMessage(randomQuestion.MainQuestion);
            chatClient.SendMessage(randomQuestion.GetRandomizedAnswers());

            _messageHint1 = new DelayedMessageAction(10, $"Hint 1: {randomQuestion.Hint1}", chatClient);
            _automatedActionSystem.AddAction(_messageHint1);
            _messageHint2 = new DelayedMessageAction(20, $"Hint 2: {randomQuestion.Hint2}", chatClient);
            _automatedActionSystem.AddAction(_messageHint2);
            _oneTimeActionEndingQuestion = new OneTimeCallBackAction(30, () => CompleteQuestion(chatClient, randomQuestion));
            _automatedActionSystem.AddAction(_oneTimeActionEndingQuestion);
        }