private void SwitchState(IFSM _newState) { //opruimen if (currentState != null) { currentState.OnStateSwitch -= SwitchState; currentState.Exit(); } //initialize _newState.Enter(); _newState.OnStateSwitch += SwitchState; //opslaan currentState = _newState; }