コード例 #1
0
 public int GetWonMatchesCount(BDDModel.Team team)
 {
     return (from p in mDC.MatchParticipations
             where p.TeamID == team.TeamID && p.Goals > p.Match.MatchParticipations.Single(o => o != p).Goals
             select p).Count();
 }
コード例 #2
0
 public int GetTotalMatchesCount(BDDModel.Team team)
 {
     return (from p in mDC.MatchParticipations
             where p.TeamID == team.TeamID
             select p).Count();
 }
コード例 #3
0
 public int GetTotalGoalsScored(BDDModel.Team team)
 {
     return (from p in mDC.MatchParticipations
             where p.TeamID == team.TeamID
             select p.Goals).ToArray().Sum();
 }
コード例 #4
0
 public int GetTotalGoalsReceived(BDDModel.Team team)
 {
     return (from p in mDC.MatchParticipations
             where p.TeamID == team.TeamID
             select p.Match.MatchParticipations.Single(o => o != p).Goals).ToArray().Sum();
 }
コード例 #5
0
 public string GetFacebookUserName(BDDModel.Team team)
 {
     return team.Player.Name + " " + team.Player.Surname;
 }
コード例 #6
0
        private TransferModel.TeamDetails RefreshTeamDetailsInner(BDDModel.Team theTeam)
        {
            var ret = new TransferModel.TeamDetails();

            // Para el calculo de los averages, cogemos sólo los titulares
            var myAlignedPlayers = (from sp in theTeam.SoccerPlayers
                                    where sp.FieldPosition < 100
                                    select sp);

            ret.AverageWeight = (int)Math.Ceiling(myAlignedPlayers.Average(sp => sp.Weight));
            ret.AverageSliding = (int)Math.Ceiling(myAlignedPlayers.Average(sp => sp.Sliding));
            ret.AveragePower = (int)Math.Ceiling(myAlignedPlayers.Average(sp => sp.Power));

            ret.Fitness = theTeam.Fitness;

            ret.SpecialSkillsIDs = (from s in theTeam.SpecialTrainings
                                    where s.IsCompleted
                                    select s.SpecialTrainingDefinitionID).ToList();

            return ret;
        }