Exemplo n.º 1
0
        private void MakeAnalysis(FootballGamePM game, string prediction, bool winCondition, bool deleteCondition)
        {
            if (!game.Predictions.Any(p => p.Name == prediction))
            {
                return;
            }

            PredictionSM predict = game.Predictions.Where(p => p.Name == prediction).FirstOrDefault();

            // That is only for pased games. The new games havn't play yet and they don't have statistics.
            if (deleteCondition)
            {
                game.Predictions.Remove(predict);
                return;
            }

            if (winCondition)
            {
                predict.Result = ServiceConstants.Yes;
            }
            else
            {
                predict.Result = ServiceConstants.No;
            }
        }
Exemplo n.º 2
0
 public BasicAnalysis(FootballGamePM game, List <FootballGameSM> gamesBetweenBothTeams,
                      List <FootballGameSM> homeTeamGames, List <FootballGameSM> awayTeamGames,
                      int allGamesCount, int allHomeOrAwayGamesCount, int lastGamesCount = 0, int lastHomeOrAwayGamesCount = 0)
 {
     this.Game = game;
     this.gamesBetweenBothTeams    = gamesBetweenBothTeams;
     this.homeTeamGames            = homeTeamGames;
     this.awayTeamGames            = awayTeamGames;
     this.allGamesCount            = allGamesCount;
     this.allHomeOrAwayGamesCount  = allHomeOrAwayGamesCount;
     this.lastGamesCount           = lastGamesCount;
     this.lastHomeOrAwayGamesCount = lastHomeOrAwayGamesCount;
 }
Exemplo n.º 3
0
        private void AddAllAnalyzesToGame(FootballGamePM game, List <FootballGameSM> gamesBetweenBothTeams, List <FootballGameSM> homeTeamGames, List <FootballGameSM> awayTeamGames, string typeGames)
        {
            Result1X2 result1X2 = new Result1X2(game, gamesBetweenBothTeams, homeTeamGames, awayTeamGames, 40, 20, 10, 5);

            if (typeGames == PastGames && game.GameStatistic != null)
            {
                Corners corners = new Corners(game, gamesBetweenBothTeams, homeTeamGames, awayTeamGames, 10, 10, 0, 0);
            }
            else if (typeGames == NextGames)
            {
                Corners corners = new Corners(game, gamesBetweenBothTeams, homeTeamGames, awayTeamGames, 10, 10, 0, 0);
            }
        }
Exemplo n.º 4
0
        public Result1X2(FootballGamePM game, List <FootballGameSM> gamesBetweenBothTeams,
                         List <FootballGameSM> homeTeamGames, List <FootballGameSM> awayTeamGames,
                         int allGamesCount, int allHomeOrAwayGamesCount, int lastGamesCount = 0, int lastHomeOrAwayGamesCount = 0)
            : base(game, gamesBetweenBothTeams, homeTeamGames, awayTeamGames, allGamesCount, allHomeOrAwayGamesCount, lastGamesCount, lastHomeOrAwayGamesCount)
        {
            if (this.CheckForZeroCount())
            {
                return;
            }

            this.GamesBothTeams();
            this.Result1();
            this.Result2();
            this.DivideBetweenHomeAndAway();
            this.ResultDraw();
        }
Exemplo n.º 5
0
        public Corners(FootballGamePM game, List <FootballGameSM> gamesBetweenBothTeams,
                       List <FootballGameSM> homeTeamGames, List <FootballGameSM> awayTeamGames,
                       int allGamesCount, int allHomeOrAwayGamesCount, int lastGamesCount = 0, int lastHomeOrAwayGamesCount = 0)
            : base(game, gamesBetweenBothTeams, homeTeamGames, awayTeamGames, allGamesCount, allHomeOrAwayGamesCount, lastGamesCount, lastHomeOrAwayGamesCount)
        {
            if (this.CheckForGameStatistic())
            {
                return;
            }

            this.SumPredictCorners = 0;

            this.HTCorners();
            this.ATCorners();
            this.SumCorners();

            this.Over8Corners();
            this.Under12Corners();
        }