private void UpdateMainWindow() { CurrentGameTextBox.Text = $"{_gameBrain.GetCurrentGameInt() + 1}/{_gameBrain.GetGamesCount()}"; CurrentRoundTextBox.Text = $"{_gameBrain.GetCurrentRoundInt() + 1}/{_gameBrain.GetRoundsCount()}"; PlayStatusRectangle.Fill = IsCurrentRoundSongType() ? Brushes.DarkGreen : Brushes.DarkRed; RoundTitleTextBlock.Text = _gameBrain.GetCurrentRound().Title; RoundObjectiveTextBlock.Text = _gameBrain.GetCurrentRound().Objective; RoundAnswerTextBlock.Text = _gameBrain.GetCurrentRound().Answer; RoundTypeTextBlock.Text = _gameBrain.GetCurrentRound().Type; RoundMaxScoreTextBlock.Text = $"{_gameBrain.GetCurrentRound().MaxScore}"; int[] currentScores = _gameBrain.GetCurrentScores(); int[] completeScores = _gameBrain.GetCompleteScores(); for (int i = 0; i < _gameBrain.GetCurrentScores().Count(); i++) { _currentScoreTextBlocks[i].Text = $"{currentScores[i]}"; _completeScoreTextBlocks[i].Text = $"{completeScores[i]}"; } }
public MainWindow() { InitializeComponent(); _log = new SimpleLogger(); _gameBrain = new GameBrain(_log); if (_gameBrain.GetGamesCount() == 0) { MessageBox.Show("No games found! Please check the settings JSON", "Fatal Error", MessageBoxButton.OK, MessageBoxImage.Error); Application.Current.Shutdown(); } InitializeScoreBlocks(DefaultValues.TEAMNAMES); _scoreBoard = new ScoreBoard(_log); _random = new Random(); UpdateMainWindow(); }