コード例 #1
0
        public static PlayerGameweekPerformance CreatePlayerPerformanceFromFixtures(int playerId, string playerName, Position playerPosition, IEnumerable<PastFixture> fixtures)
        {
            var performance = new PlayerGameweekPerformance
            {
                Position = playerPosition,
                PlayerId = playerId,
                PlayerName = playerName,
                Assists = fixtures.Sum(x => x.Assists),
                Bonus = fixtures.Sum(x => x.Bonus),
                CleanSheets = fixtures.Sum(x => x.CleanSheets),
                GoalsConceded = fixtures.Sum(x => x.GoalsConceded),
                GoalsScored = fixtures.Sum(x => x.GoalsScored),
                MinutesPlayed = fixtures.Sum(x => x.MinutesPlayed),
                OppositionGoals = fixtures.Sum(x => x.OppositionGoals),
                OwnGoals = fixtures.Sum(x => x.OwnGoals),
                PenaltiesMissed = fixtures.Sum(x => x.PenaltiesMissed),
                PenaltiesSaved = fixtures.Sum(x => x.PenaltiesSaved),
                RedCards = fixtures.Sum(x => x.RedCards),
                Saves = fixtures.Sum(x => x.Saves),
                TotalPointsScored = fixtures.Sum(x => x.TotalPointsScored),
                YellowCards = fixtures.Sum(x => x.YellowCards)
            };

            return performance;
        }
コード例 #2
0
        private static IList<PlayerGameweekPerformance> CreatePlayerGameweekPerformances(int pointsScoredPerPlayer)
        {
            var performances = new List<PlayerGameweekPerformance>();

            for(int i=0;i< 11;i++)
            {
                var performance = new PlayerGameweekPerformance {TotalPointsScored = pointsScoredPerPlayer};
                performances.Add(performance);
            }

            return performances;
        }