Exemple #1
0
        private void ProcessTeam(string teamline, TeamScore scoreData, int pos)
        {
            string raw = teamline.Trim();

            int scoreIndex = raw.Length;

            while (char.IsDigit(raw[--scoreIndex]))
            {
                ;
            }
            scoreIndex++;

            string team  = raw.Substring(0, scoreIndex).Trim();
            string score = raw.Substring(scoreIndex).Trim();

            if (scoreData.Game.Week.Name == "Week 12" && scoreData.Game.Week.Season.Year == 2008 &&
                score == "" && team == "Fighting Calrissians")
            {
                // there is no score data for FC this week, so this was calculated by totaling the
                // results of all games and subtracting the seaons points for.
                score = "819";
            }

            if (scoreData.Game.Week.Name == "Week 1" && scoreData.Game.Week.Season.Year == 2003 &&
                team == "Phantom")
            {
                // in 2003 the team was called the Phantoms, but was recorded as
                // phantom
                team = "Phantom120";
            }

            int scoreInt = Convert.ToInt32(score);

            Team teamData = teamResolver.GetTeamByName(team);

            teamData.Games.Add(scoreData.Game);

            scoreData.Team  = teamData;
            scoreData.Score = scoreInt;
        }
Exemple #2
0
        private void ProcessTeam(string teamline, TeamScore scoreData, int pos)
        {
            string raw = teamline.Trim();

            int scoreIndex = raw.Length;

            while (char.IsDigit(raw[--scoreIndex]))
            {
                ;
            }
            scoreIndex++;

            string team  = raw.Substring(0, scoreIndex).Trim();
            string score = raw.Substring(scoreIndex).Trim();

            int scoreInt = Convert.ToInt32(score);

            Team teamData = _teamResolver.GetTeamByName(team);

            teamData.Games.Add(scoreData.Game);

            scoreData.Team  = teamData;
            scoreData.Score = scoreInt;
        }