示例#1
0
 public bool Equals(GameInfo other)
 {
     return string.Equals(this.Summary, other.Summary)
         && this.Date.Equals(other.Date)
         && this.FirstTeam.Equals(other.FirstTeam)
         && this.SecondTeam.Equals(other.SecondTeam);
 }
示例#2
0
        public override Dictionary<string, Game> ParseSport()
        {
            var address = this.Domain + "/su/popular/Football/";
            var resultDict = new Dictionary<string, Game>();
            var webGet = new HtmlWeb();
            var page = webGet.Load(address);
            var content = page.DocumentNode.SelectNodes("//div[@class='category-container']");
            foreach (var commonDiv in content)
            {

                var gameInfo = new GameInfo();
                var innerDivs = commonDiv.SelectNodes("*");
                var infoByGame = innerDivs[0].SelectNodes(".//span[@class='nowrap']");
                foreach (var split in infoByGame)
                {
                    gameInfo.Summary += split.InnerText;
                }

                if (this.leagueExceptionList.Any(a => gameInfo.Summary.Contains(a)))
                {
                    continue;
                }

                var trGame = innerDivs[1].SelectNodes(".//tr[@class=' event-header']");
                foreach (var tdGame in trGame)
                {
                    var id = tdGame.ParentNode.Attributes["data-event-treeid"].Value;
                    gameInfo.FirstTeam = new TeamName
                    {
                        RU = tdGame.SelectNodes(".//div[@data-ellipsis='{}']")[0].InnerText
                    };

                    gameInfo.SecondTeam = new TeamName
                    {
                        RU = tdGame.SelectNodes(".//div[@data-ellipsis='{}']")[1].InnerText
                    };

                    //todo check Junior

                    gameInfo.Date = ParseDate(tdGame.SelectSingleNode(".//td[@class='date']").InnerText);
                    var coefs = tdGame.SelectNodes("td/span");
                    resultDict.Add(id, new Game(gameInfo, ParseCoefSet(coefs)));

                }
            }

            return resultDict;
        }
示例#3
0
文件: Game.cs 项目: ForkerTeam/Forker
 public Game(GameInfo info, BetsName betsName)
 {
     this.Info = info;
     this.BetsName = betsName;
     this.Coefficients = new Dictionary<CoefType, ICoefficient>();
 }
示例#4
0
文件: Game.cs 项目: ForkerTeam/Forker
 public Game(GameInfo info, Dictionary<CoefType, ICoefficient> coefs, BetsName betsName = default(BetsName))
 {
     this.Info = info;
     this.Coefficients = coefs;
     this.BetsName = betsName;
 }