public TourneyOptions(TourneyConfig config)
        {
            Config = config;

            InitializeComponent();
            DG_RankValues.ItemsSource = RankValues;
        }
Beispiel #2
0
        public TourneyView()
        {
            InitializeComponent();

            Config = TourneyConfig.ReadFromFile();

            GV_GameView.MatchChanging += OnMatchChanging;
        }
Beispiel #3
0
 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();
        }
Beispiel #5
0
        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);
        }