/// <summary /> public static IEnumerable<K> ConvertAndInitialize(FanastySeason season) { Collection<K> results = new Collection<K>(); foreach (NFLPlayer player in season.GetAll(FanastyPosition.K)) { K k = new K(player); int points = player.FanastyPoints(); int games = player.GamesPlayed(); if (games > 0) { k.PointsOverReplacement = (points / games) - season.ReplacementValue.K; k.PointsOverReplacement3G = (player.FanastyPointsInRecentGames(3) / 3) - season.ReplacementValue.K; } k.FanastyPoints = points; k.TotalBonuses = player.TotalBonuses(); results.Add(k); } return results; }
/// <summary /> public static IEnumerable<QB> ConvertAndInitialize(FanastySeason season) { Collection<QB> results = new Collection<QB>(); foreach (NFLPlayer player in season.GetAll(FanastyPosition.QB)) { QB qb = new QB(player); int points = player.FanastyPoints(); int games = player.GamesPlayed(); if (games > 0) { qb.PointsOverReplacement = (points / games) - season.ReplacementValue.QB; qb.PointsOverReplacement3G = (player.FanastyPointsInRecentGames(3) / 3) - season.ReplacementValue.QB; } qb.FanastyPoints = points; qb.TotalBonuses = player.TotalBonuses(); results.Add(qb); } return results; }
/// <summary /> public static IEnumerable<WR> ConvertAndInitialize(FanastySeason season) { Collection<WR> results = new Collection<WR>(); foreach (NFLPlayer player in season.GetAll(FanastyPosition.WR)) { WR wr = new WR(player); int points = player.FanastyPoints(); int games = player.GamesPlayed(); if (games > 0) { wr.PointsOverReplacement = (points / games) - season.ReplacementValue.WR; wr.PointsOverReplacement3G = (player.FanastyPointsInRecentGames(3) / 3) - season.ReplacementValue.WR; } wr.FanastyPoints = points; wr.TotalBonuses = player.TotalBonuses(); results.Add(wr); } return results; }