public void StartGame(GameSettings settings) { GameBuilder gameBuilder = new GameBuilder(_ui, _rng, _species); GameHandler gameHandler = gameBuilder.BuildGame(settings); try { gameHandler.Process(); } catch (Exception ex) { Logger.Fatal($"Received error from GameHandler: {ex.Message}."); Logger.Debug($"Stacktrace: {ex.StackTrace}."); _ui.OnError(ex.Message); } }
/// <summary> /// Handle choice made from frontend. /// </summary> /// <param name="input">Input from frontend.</param> private void OnChoiceFromFrontend(string input) { if (String.IsNullOrEmpty(input)) { string err = "Null choice."; Logger.Error(err); _frontEnd.OnError(err); return; } _lastArgument = input; _eventSignal.Set(); }