public TourneyOptions(TourneyConfig config) { Config = config; InitializeComponent(); DG_RankValues.ItemsSource = RankValues; }
public TourneyView() { InitializeComponent(); Config = TourneyConfig.ReadFromFile(); GV_GameView.MatchChanging += OnMatchChanging; }
private void BTN_GoToResults_Click(object sender, RoutedEventArgs e) { if (CurrentGame.GameState != GameState.Finished) { MessageBox.Show("You must submit the results for this match before continuing", "Submit Results", MessageBoxButton.OK, MessageBoxImage.Exclamation); } else { ResultsView results = new ResultsView(TourneyView.Tourney, TourneyConfig.ReadFromFile()); results.Owner = Application.Current.MainWindow; results.Show(); } }
public ResultsView(Tourney tourney, TourneyConfig config) { InitializeComponent(); Tourney = tourney; Config = config; PlayerScores = new Dictionary <Player, int>(); GetPlayerScores(); DisplayResults(); }
public Player GetWinner() { Player result = null; foreach (Player player in PlayerRank.Keys) { if (result == null) { result = player; } else { if (TourneyConfig.IsWorthMoreThan(PlayerRank[player], PlayerRank[result])) { result = player; } } } return(result); }