public void SetState(States state) { _state.OnExit(this); switch (state) { case States.AVALIABLE: _state = available; break; case States.BUSY: _state = busy; break; case States.IDLE: _state = idle; break; } _state.OnEnter(this); }