Пример #1
0
 public void StartBrainstorming()
 {
     _brainstormingDalService.StartBrainstormingFinding(_context.CurrentFinding.Id);
     _context.CurrentFinding           = _brainstormingDalService.GetFinding(_context.CurrentFinding.Id);
     commitIdeaIndex                   = 0;
     _brainstormingModel.BrainWaveSent = false;
 }
Пример #2
0
        private void Timer_Elapsed(object sender, ElapsedEventArgs e)
        {
            var backendFinding = _brainstromingDalService.GetFinding(_context.CurrentFinding.Id);

            if (backendFinding?.CurrentRound != _context.CurrentFinding.CurrentRound)
            {
                _context.CurrentFinding = backendFinding;
                _logger.Info("Brainstorming has started, changing state to running");
                ChangeStateEvent?.Invoke(new RunningState(_logger, _brainstromingDalService, _context, _brainstormingModel));
            }
        }
Пример #3
0
        private void UpdateRound()
        {
            _nextCheckRoundTimer.Stop();
            var backendFinding = _brainstormingDalService.GetFinding(_context.CurrentFinding.Id);

            if (backendFinding?.CurrentRound == -1)
            {
                _context.CurrentFinding = backendFinding;
                ChangeStateEvent?.Invoke(new EndedState(_context, _brainstormingModel));
                return;
            }
            else if (backendFinding?.CurrentRound != _context.CurrentFinding.CurrentRound)
            {
                _context.CurrentFinding = backendFinding;
                _logger.Info("Round has changed, proceeding to next round");
                NextRound();
            }
            _nextCheckRoundTimer.Start();
        }