Example #1
0
        public override DDDEvent ToDDDEvent(int currentTime, DDDAdapter ddd)
        {
            ChangeStateEvent ev = new ChangeStateEvent();

            ev.ObjectID  = this.ID;
            ev.StateName = this.State;
            ev.Time      = this.TimeAfter + currentTime; //not sure why it parses an int to a string in the first place...
            return(ev);
        }
Example #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));
            }
        }
Example #3
0
 public void ChangeState(T nowValue)
 {
     if (ChangeStateEvent != null)
     {
         ChangeStateEvent.Invoke(nowValue);
     }
     if (TmpChangeStateEvent != null)
     {
         TmpChangeStateEvent.Invoke(nowValue);
     }
     NowValue  = nowValue;
     IsSpecial = true;
 }
Example #4
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();
        }
Example #5
0
 public void OnChangeStateEvent(object sender, ChangeStateEventArgs e)
 {
     ChangeStateEvent?.Invoke(sender, e);
 }
Example #6
0
 ChangeStateEvent ChangeState;                                       // ステートが変わった時に呼び出すデリゲート
 public void RegisterEvent_ChangeState(ChangeStateEvent _event)      // デリゲートにメソッドを追加する
 {
     ChangeState += _event;
 }
Example #7
0
 void PublishChangeStateEvent()
 {
     ChangeStateEvent?.Invoke(this);
 }
 void OnStateChangeEvent(ChangeStateEvent e)
 {
     this.currentState = e.nextState;
 }