예제 #1
0
        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);
            }
        }
예제 #2
0
        /// <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();
        }