public void Tick(DateTime now, int param) { Zork5v5StateMachine.StateHandler handler = this.Handlers[(int)this._CurrState]; if (handler != null) { handler.Update(now, param); } }
public void SetCurrState(Zork5v5StateMachine.StateType state, DateTime now, int param) { Zork5v5StateMachine.StateHandler oldHandler = this.Handlers[(int)this._CurrState]; if (oldHandler != null) { oldHandler.Leave(now, param); } this._CurrState = state; Zork5v5StateMachine.StateHandler newHandler = this.Handlers[(int)this._CurrState]; this._CurrStateEnterTicks = now.Ticks; if (newHandler != null) { newHandler.Enter(now, param); } }
public void Install(Zork5v5StateMachine.StateHandler handler) { this.Handlers[(int)handler.State] = handler; }