예제 #1
0
 public HtmlPageParser(IWaFFLDataSource dataSource, ITeamResolver teamResolver)
 {
     _dataSource       = dataSource;
     _seasonParser     = new TableDataParser("Week 1");
     _postseasonParser = new TableDataParser("Wild Card Week", "Wild Card", "Semi-Finals");
     _extractor        = new GameExtractor(teamResolver);
     _playoffExtractor = new PlayoffGameExtractor(teamResolver);
 }
예제 #2
0
        public static string GetBestTeamPlayerDivString(this Team t, ITeamResolver splatTagController)
        {
            var      playersForTeam = splatTagController.GetPlayersForTeam(t);
            Division highestDiv     = t.CurrentDiv;
            Team?    highestDivTeam = null;
            Player?  bestPlayer     = null;

            foreach (var(player, mostRecent) in playersForTeam)
            {
                if (mostRecent && player.TeamInformation.Count > 1)
                {
                    foreach (Team playerTeam in player.TeamInformation.GetAllTeamsUnordered().Select(id => splatTagController.GetTeamById(id)))
                    {
                        if (playerTeam.CurrentDiv < highestDiv)
                        {
                            highestDiv     = playerTeam.CurrentDiv;
                            bestPlayer     = player;
                            highestDivTeam = playerTeam;
                        }
                    }
                }
            }

            if (bestPlayer == null || highestDiv == Division.Unknown)
            {
                // Don't show anything it's pointless.
                return("");
            }
            else if (highestDiv.Value == t.CurrentDiv.Value)
            {
                return("No higher div players.");
            }
            else
            {
                Debug.Assert(bestPlayer != null && highestDivTeam != null);
                return($"Highest div'd player is {bestPlayer.Name} at {highestDiv} playing for {highestDivTeam.Name}.");
            }
        }
예제 #3
0
 public PlayoffGameExtractor(ITeamResolver teamResolver)
 {
     _teamResolver = teamResolver;
 }
예제 #4
0
 public GameExtractor(ITeamResolver resolver)
 {
     teamResolver = resolver;
 }
예제 #5
0
 public Ranker(IDriveResolver driveResolver, IGameResolver gameResolver, ITeamResolver teamResolver)
 {
     this.driveResolver = driveResolver;
     this.gameResolver  = gameResolver;
     this.teamResolver  = teamResolver;
 }