Exemplo n.º 1
0
 public void Tick(DateTime now)
 {
     ZhengBaStateMachine.StateHandler handler = this.Handlers[(int)this._CurrState];
     if (handler != null)
     {
         handler.Update(now);
     }
 }
Exemplo n.º 2
0
 public void SetCurrState(ZhengBaStateMachine.StateType state, DateTime now)
 {
     ZhengBaStateMachine.StateHandler oldHandler = this.Handlers[(int)this._CurrState];
     if (oldHandler != null)
     {
         oldHandler.Leave(now);
     }
     this._CurrState = state;
     ZhengBaStateMachine.StateHandler newHandler = this.Handlers[(int)this._CurrState];
     this._CurrStateEnterTicks = now.Ticks;
     if (newHandler != null)
     {
         newHandler.Enter(now);
     }
 }
Exemplo n.º 3
0
 public void Install(ZhengBaStateMachine.StateHandler handler)
 {
     this.Handlers[(int)handler.State] = handler;
 }