public TriviaBotService(IChatService chatService, IScoreKeeperService scoreKeeper, ILifetimeScorekeeper lifetimeScoreService, IQuestionSetManager questionSetManager)
        {
            _chatService          = chatService;
            _questionSetManager   = questionSetManager;
            _scoreKeeper          = scoreKeeper;
            _lifetimeScoreService = lifetimeScoreService;

            hasAnsweredCurrentQuestion = new Dictionary <ulong, bool>();
            hasVotedToSkip             = new Dictionary <ulong, ulong>();

            // The timer which represents how often to send messages
            messageSendTimer = new Timer
            {
                AutoReset = true,
                Enabled   = true,
                Interval  = 500
            };
            messageSendTimer.Elapsed += MessageTimer_Elapsed;
            // A queue which holds our to-be-sent messages
            messageSendingQueue = new Queue <string>();

            _questionTimer           = new Timer();
            _questionTimer.AutoReset = false;
            _questionTimer.Enabled   = false;
            _questionTimer.Elapsed  += QuestionTimer_Elapsed;
            _questionTimer.Interval  = questionTimerLength * 1000;
        }
示例#2
0
        public TriviaManagerService(IQuestionSetManager questionSetManager, IScoreKeeperService scoreKeeper)
        {
            this.questionSetManager = questionSetManager;
            this.scoreKeeper        = scoreKeeper;

            hasAnsweredCurrentQuestion = new Dictionary <ulong, bool>();
            hasVotedToSkip             = new Dictionary <ulong, ulong>();
            questionTimer           = new Timer();
            questionTimer.AutoReset = false;
            questionTimer.Enabled   = false;
            questionTimer.Elapsed  += QuestionTimer_Elapsed;
            questionTimer.Interval  = questionTimerLength * 1000;
        }