public void Calculate( string season, string week ) { var theWeek = new NFLWeek( season, week ); theWeek.LoadGameList(); foreach ( var nflStat in theWeek.GameList().Cast<NFLGame>() .Select( game => game.GenerateGridStatsOutput() ).SelectMany( statList => statList ) ) PutStat( nflStat ); }
public void Calculate( string season, string week ) { var theWeek = new NFLWeek( season, week ); theWeek.LoadGameList(); Announce( string.Format("{0} Games loaded for {1}:{2}", theWeek._gameList.Count, season, week ) ); foreach ( var nflStat in theWeek.GameList().Cast<NFLGame>() .Select( game => game.GenerateYahooOutput() ).SelectMany( statList => statList ) ) PutStat( nflStat ); }
public void Calculate( string season, string week ) { var theWeek = new NFLWeek( season, week ); if (!theWeek.HasPassed()) return; theWeek.LoadGameList(); foreach ( var nflStat in theWeek.GameList().Cast<NFLGame>() .Select( game => game.GenerateStats() ).SelectMany( statList => statList ) ) PutStat( nflStat ); }
public void Calculate(string season, string week) { var theWeek = new NFLWeek(season, week); theWeek.LoadGameList(); foreach (var nflStat in theWeek.GameList().Cast <NFLGame>() .Select(game => game.GenerateYahooOutput()).SelectMany(statList => statList)) { PutStat(nflStat); } }
public void Calculate(string season, string week) { var theWeek = new NFLWeek(season, week); if (!theWeek.HasPassed()) { return; } theWeek.LoadGameList(); foreach (var nflStat in theWeek.GameList().Cast <NFLGame>() .Select(game => game.GenerateStats()).SelectMany(statList => statList)) { PutStat(nflStat); } }
private string GenerateBody() { var bodyOut = new StringBuilder(); bodyOut.AppendLine(string.Format("Recording actual metrics for Week {0}:{1}", Season, Week)); bodyOut.AppendLine(); // Foreach game in the week var theWeek = new NFLWeek(Season, Week); theWeek.LoadGameList(); foreach (NFLGame game in theWeek.GameList()) { var homeList = game.LoadLineupPlayers(game.HomeTeam); TallyMetrics(bodyOut, game, homeList); var awayList = game.LoadLineupPlayers(game.AwayTeam); TallyMetrics(bodyOut, game, awayList); } return(bodyOut.ToString()); }
private string GenerateBody() { var bodyOut = new StringBuilder(); bodyOut.AppendLine(string.Format("Recording actual metrics for Week {0}:{1}", Season, Week ) ); bodyOut.AppendLine(); // Foreach game in the week var theWeek = new NFLWeek(Season, Week); theWeek.LoadGameList(); foreach (NFLGame game in theWeek.GameList()) { var homeList = game.LoadLineupPlayers(game.HomeTeam); TallyMetrics( bodyOut, game, homeList); var awayList = game.LoadLineupPlayers(game.AwayTeam); TallyMetrics(bodyOut, game, awayList); } return bodyOut.ToString(); }