Ejemplo n.º 1
0
        public string MostPlayedWith()
        {
            var playedWithMax      = 0;
            var mostPlayedWithGuid = Guid.Empty;

            foreach (var teammate in teammateStats.Keys)
            {
                if (teammateStats[teammate][0] > playedWithMax)
                {
                    playedWithMax      = teammateStats[teammate][0];
                    mostPlayedWithGuid = teammate;
                }
            }
            var teammatePlayer = playerRetriever.GetPlayerById(mostPlayedWithGuid);

            return(teammatePlayer.FirstName + " " + teammatePlayer.LastName);
        }
Ejemplo n.º 2
0
 public IActionResult OnGet(Guid playerID)
 {
     if (!env.IsDevelopment())
     {
         return(Redirect("~/NoPermission"));
     }
     if (playerID == Guid.Empty)
     {
         return(Redirect("./NotFound"));
     }
     player = playerRetriever.GetPlayerById(playerID);
     return(Page());
 }
Ejemplo n.º 3
0
        public IActionResult OnGet(Guid?playerID)
        {
            if (!env.IsDevelopment())
            {
                return(Redirect("../NoPermission"));
            }
            if (playerID.HasValue)
            {
                Player = playerRetriever.GetPlayerById(playerID.Value);
            }
            else
            {
                Player = new Player();
            }

            if (Player == null)
            {
                return(RedirectToPage("./NotFound"));
            }
            return(Page());
        }
Ejemplo n.º 4
0
 public IActionResult OnGet(Guid playerID)
 {
     Player = playerRetriever.GetPlayerById(playerID);
     if (Player == null)
     {
         return(RedirectToPage("./NotFound"));
     }
     detailHandler.SetupTeammateStats(playerID);
     gamesPlayed             = detailHandler.GamesPlayedIn(playerID);
     MostPlayedWith          = detailHandler.MostPlayedWith();
     BestPercentageWith      = detailHandler.BestWinPercentageTeammate();
     WinPercentage           = (float)Player.GamesWon / Player.GamesPlayed * 100;
     GoalsAgainstPerGame     = (float)Player.GoalsAgainst / Player.GamesPlayed;
     GoalsForPerGame         = (float)Player.GoalsFor / Player.GamesPlayed;
     WinPctStanding          = detailHandler.WinPercentageStanding(Player);
     GoalsForAvgStanding     = detailHandler.GoalsForAverageStanding(Player);
     GoalsAgainstAvgStanding = detailHandler.GoalsAgainstAverageStanding(Player);
     OffenseWinPct           = detailHandler.OffenseWinPct(Player);
     DefenseWinPct           = detailHandler.DefenseWinPct(Player);
     RedWinPct  = detailHandler.RedSideWinPct(Player);
     BlueWinPct = detailHandler.BlueSideWinPct(Player);
     avgElo     = detailHandler.AverageEloByPosition(Player);
     return(Page());
 }