public PlayerGameweekHistory(IClub club, List <object[]> RawGameweeks) { Gameweeks = new List <PlayerGameweek>(); MinutesPlayed = 0; Goals = 0; Assists = 0; Conceded = 0; CleanSheets = 0; PenaltySaves = 0; PenaltiesMissed = 0; YellowCards = 0; RedCards = 0; Saves = 0; Bonus = 0; foreach (var gw in RawGameweeks) { var playerGw = new PlayerGameweek(club, gw); Gameweeks.Add(playerGw); // calculate totals MinutesPlayed += playerGw.MinutesPlayed; Goals += playerGw.GoalsScored; Assists += playerGw.Assists; Conceded += playerGw.GoalsConceded; CleanSheets += playerGw.CleanSheets; PenaltySaves += playerGw.PenaltiesSaved; PenaltiesMissed += playerGw.PenaltiesMissed; YellowCards += playerGw.YellowCards; RedCards += playerGw.RedCards; Saves += playerGw.Saves; Bonus += playerGw.Bonus; OwnGoals += playerGw.OwnGoals; } GamesPlayed = RawGameweeks.Count(); }
public PlayerGameweekHistory(IClub club, List<object[]> RawGameweeks) { Gameweeks = new List<PlayerGameweek>(); MinutesPlayed = 0; Goals = 0; Assists = 0; Conceded = 0; CleanSheets = 0; PenaltySaves = 0; PenaltiesMissed = 0; YellowCards = 0; RedCards = 0; Saves = 0; Bonus = 0; foreach (var gw in RawGameweeks) { var playerGw = new PlayerGameweek(club, gw); Gameweeks.Add(playerGw); // calculate totals MinutesPlayed += playerGw.MinutesPlayed; Goals += playerGw.GoalsScored; Assists += playerGw.Assists; Conceded += playerGw.GoalsConceded; CleanSheets += playerGw.CleanSheets; PenaltySaves += playerGw.PenaltiesSaved; PenaltiesMissed += playerGw.PenaltiesMissed; YellowCards += playerGw.YellowCards; RedCards += playerGw.RedCards; Saves += playerGw.Saves; Bonus += playerGw.Bonus; OwnGoals += playerGw.OwnGoals; } GamesPlayed = RawGameweeks.Count(); }