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); }
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)); } }
public void ChangeState(T nowValue) { if (ChangeStateEvent != null) { ChangeStateEvent.Invoke(nowValue); } if (TmpChangeStateEvent != null) { TmpChangeStateEvent.Invoke(nowValue); } NowValue = nowValue; IsSpecial = true; }
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(); }
public void OnChangeStateEvent(object sender, ChangeStateEventArgs e) { ChangeStateEvent?.Invoke(sender, e); }
ChangeStateEvent ChangeState; // ステートが変わった時に呼び出すデリゲート public void RegisterEvent_ChangeState(ChangeStateEvent _event) // デリゲートにメソッドを追加する { ChangeState += _event; }
void PublishChangeStateEvent() { ChangeStateEvent?.Invoke(this); }
void OnStateChangeEvent(ChangeStateEvent e) { this.currentState = e.nextState; }