Exemple #1
0
 private void InitTournament()
 {
     foreach (Game game in CurrentTournament.Games)
     {
         GameViewModel gameViewModel = new GameViewModel(game);
         Games.Add(gameViewModel);
     }
     foreach (Player player in CurrentTournament.Players)
     {
         PlayerViewModel playerViewModel = new PlayerViewModel(player);
         Players.Add(playerViewModel);
         foreach (Game game in CurrentTournament.Games)
         {
             if (game.BlackPlayer.Equals(player) || game.WhitePlayer.Equals(player))
             {
                 player.Games.Add(game);
             }
         }
     }
 }
 private void InitTournament()
 {
     foreach (Game game in CurrentTournament.Games)
     {
         GameViewModel gameViewModel = new GameViewModel(game);
         Games.Add(gameViewModel);
     }
     foreach (Player player in CurrentTournament.Players)
     {
         PlayerViewModel playerViewModel = new PlayerViewModel(player);
         Players.Add(playerViewModel);
         foreach(Game game in CurrentTournament.Games)
         {
             if(game.BlackPlayer.Equals(player)||game.WhitePlayer.Equals(player))
             {
                 player.Games.Add(game);
             }
         }
     }
 }