private void ToggleDebugMode(ToggleDebugModeEvent gameEvent) { bool?debugMode = null; if (gameEvent.EventParams.Count > 0) { debugMode = (bool?)gameEvent.EventParams[0]; } if (debugMode == null) { _gameStateHelper.SetDebugMode(!_gameStateHelper.DebugMode); return; } _gameStateHelper.SetDebugMode(debugMode.Value); }