Ejemplo n.º 1
0
        private void UpdateRoster()
        {
            var startingPlayers = _roster.Players
                                  .Where(player => player.Starter == true);

            Starters.Clear();

            foreach (Player player in startingPlayers)
            {
                Starters.Add(new PlayerViewModel(player.Name, player.Number));
            }

            var benchPlayers = _roster.Players
                               .Where(player => player.Starter == false);

            Bench.Clear();

            foreach (Player player in benchPlayers)
            {
                Bench.Add(new PlayerViewModel(player.Name, player.Number));
            }
        }
Ejemplo n.º 2
0
        private void UpdateRosters()
        {
            var startingPlayers = from player in _roster.players
                                  where player.Starter
                                  select player;

            Starters.Clear();
            foreach (Player player in startingPlayers)
            {
                Starters.Add(new PlayerViewModel(player.Name, player.Number));
            }

            var benchPlayers = from player in _roster.players
                               where player.Starter == false
                               select player;

            Bench.Clear();
            foreach (Player player in benchPlayers)
            {
                Bench.Add(new PlayerViewModel(player.Name, player.Number));
            }
        }