コード例 #1
0
ファイル: Helper.cs プロジェクト: Poison159/TheFinalProOnePal
        public static void assignDefaultStats(TeamTournamentStat homeStats, TeamTournamentStat awayStats, Result result)
        {
            homeStats.gamesPlayed++;
            homeStats.goalsFor     += result.homeGoals;
            homeStats.goalsAgainst += result.awayaGoals;
            homeStats.getGoalDiff();

            awayStats.gamesPlayed++;
            awayStats.goalsFor     += result.awayaGoals;
            awayStats.goalsAgainst += result.homeGoals;
            awayStats.getGoalDiff();
            PopulateGamesWon(homeStats, awayStats, result);
        }
コード例 #2
0
ファイル: Helper.cs プロジェクト: Poison159/TheProOnePal
        public static void assignDefaultStats(string tournamentName, Team homeTeam, Team awayTeam, Result result, ApplicationDbContext db)
        {
            TeamTournamentStat homeStats = db.teamTournamentStats.ToList().First(x => x.teamId == homeTeam.id &&
                                                                                 x.tournamentName == tournamentName);
            TeamTournamentStat awayStats = db.teamTournamentStats.ToList().First(x => x.teamId == awayTeam.id &&
                                                                                 x.tournamentName == tournamentName);

            homeStats.gamesPlayed++;
            homeStats.goalsFor     += result.homeGoals;
            homeStats.goalsAgainst += result.awayaGoals;
            homeStats.getGoalDiff();

            awayStats.gamesPlayed++;
            awayStats.goalsFor     += result.awayaGoals;
            awayStats.goalsAgainst += result.homeGoals;
            awayStats.getGoalDiff();
            PopulateGamesWon(homeStats, awayStats, result, db);
        }