Beispiel #1
0
        public void GenerateProjections(double Average)
        {
            List <BasketballPlayer> teamPlayers = new List <BasketballPlayer>();

            teamPlayers.AddRange(PointGuards);
            teamPlayers.AddRange(ShootingGuards);
            teamPlayers.AddRange(SmallForwards);
            teamPlayers.AddRange(PowerForwards);
            teamPlayers.AddRange(Centers);

            double multiplier = (ImpliedScore - Average) / 50;
            double pgScore    = PointGuards.Sum(s => s.PreProjected);
            double sgScore    = ShootingGuards.Sum(s => s.PreProjected);
            double sfScore    = SmallForwards.Sum(s => s.PreProjected);
            double pfScore    = PowerForwards.Sum(s => s.PreProjected);
            double cScore     = Centers.Sum(s => s.PreProjected);

            TeamTotalPoints = pgScore + sgScore + sfScore + pfScore + cScore;

            foreach (var player in teamPlayers)
            {
                double projectedPointsNoMult = player.PointsPerMinute * player.TotalMinutes;
                double projectedAverage      = (projectedPointsNoMult + player.PreProjected) / 2;
                double percentOfTeam         = projectedAverage / TeamTotalPoints;
                double playerMultiplier      = (multiplier * percentOfTeam) + (percentOfTeam * player.DVPMultiplier) + 1;
                player.Projected = playerMultiplier * projectedAverage;
            }
        }
        private void BuildInitialPositionLists(List <Player> players)
        {
            foreach (var player in players)
            {
                switch (player.PlayerPosition)
                {
                case "PG":
                    PointGuards.Add(player);
                    TopPointGuards.Add(player);
                    break;

                case "SG":
                    ShootingGuards.Add(player);
                    TopShootingGuards.Add(player);
                    break;

                case "SF":
                    SmallForwards.Add(player);
                    TopSmallForwards.Add(player);
                    break;

                case "PF":
                    PowerForwards.Add(player);
                    TopPowerForwards.Add(player);
                    break;

                case "C":
                    Centers.Add(player);
                    break;
                }
            }
        }
Beispiel #3
0
        public void SetImpliedScore(double score)
        {
            ImpliedScore = score;

            PointGuards.ForEach(s => s.ImpliedScore    = score);
            ShootingGuards.ForEach(s => s.ImpliedScore = score);
            SmallForwards.ForEach(s => s.ImpliedScore  = score);
            PowerForwards.ForEach(s => s.ImpliedScore  = score);
            Centers.ForEach(s => s.ImpliedScore        = score);
        }