Esempio n. 1
0
        private void UpdateRosters(Roster roster)
        {
            var benchPlayers =
                from player in roster.Players
                where player.Starter == false
                select player;

            foreach (var player in benchPlayers)
            {
                PlayerViewModel newPlayer = new PlayerViewModel(player.Name, player.Number);
                Bench.Add(newPlayer);
            }

            var starterPlayers =
                from player in roster.Players
                where player.Starter == true
                select player;

            foreach (var player in starterPlayers)
            {
                PlayerViewModel newPlayer = new PlayerViewModel(player.Name, player.Number);
                Starters.Add(newPlayer);
            }
        }
Esempio n. 2
0
 private static IEnumerable <PlayerViewModel> DetermineBenchPlayers(Roster roster)
 {
     return(from player in roster.Players
            where player.Starter == false
            select PlayerViewModel.ValueOf(player));
 }