コード例 #1
0
		public void Tick(DateTime now, int param)
		{
			KuaFuLueDuoStateMachine.StateHandler handler = this.Handlers[(int)this._CurrState];
			if (handler != null)
			{
				handler.Update(now, param);
			}
		}
コード例 #2
0
		public void SetCurrState(KuaFuLueDuoStateMachine.StateType state, DateTime now, int param)
		{
			KuaFuLueDuoStateMachine.StateHandler oldHandler = this.Handlers[(int)this._CurrState];
			if (oldHandler != null)
			{
				oldHandler.Leave(now, param);
			}
			this._CurrState = state;
			KuaFuLueDuoStateMachine.StateHandler newHandler = this.Handlers[(int)this._CurrState];
			this._CurrStateEnterTicks = now.Ticks;
			if (newHandler != null)
			{
				newHandler.Enter(now, param);
			}
		}
コード例 #3
0
		public void Install(KuaFuLueDuoStateMachine.StateHandler handler)
		{
			this.Handlers[(int)handler.State] = handler;
		}