private void LoadRatings(DateTime when)
        {
            // load the ratings into RatingsHt for a particular date
            var ds = Utility.TflWs.GetUnitRatings(when);
            var dt = ds.Tables["uratings"];

            foreach (DataRow dr in dt.Rows)
            {
                RatingsHt.Add(dr["TEAMCODE"].ToString(), new UnitRatings(dr["RATINGS"].ToString()));
            }
            LastDateRanked = when;
        }
예제 #2
0
        private void DumpRatingsHt()
        {
            var myEnumerator = RatingsHt.GetEnumerator();
            var i            = 0;

            Utility.Announce("\t-INDEX-\t-KEY-\t-VALUE-");
            while (myEnumerator.MoveNext())
            {
                var ratings = (NibbleTeamRating)myEnumerator.Value;
                Utility.Announce(string.Format("\t[{0}]:\t{1}\t{2}", i++, myEnumerator.Key, ratings));
            }
        }
예제 #3
0
        private void DumpRatingsHt(DateTime when)
        {
            var myEnumerator = RatingsHt.GetEnumerator();
            var i            = 0;

            Utility.Announce(string.Format("\t-INDEX-\t-KEY-\t-VALUE-  Ranked at {0}", when.ToShortDateString()));
            while (myEnumerator.MoveNext())
            {
                Utility.Announce(string.Format("\t[{0}]:\t{1}\t{2}\t{3}",
                                               i++, myEnumerator.Key, myEnumerator.Value,
                                               Utility.RatingPts(myEnumerator.Value.ToString())));
            }
        }
예제 #4
0
        private void UpdateRating(string teamCode, NibbleTeamRating rating)
        {
            if (RatingsHt == null)
            {
                RatingsHt = new Hashtable();
            }

            if (!RatingsHt.ContainsKey(teamCode))
            {
                RatingsHt.Add(teamCode, new NibbleTeamRating(0, 0));
            }

            var ratings = (NibbleTeamRating)RatingsHt[teamCode];

            ratings.Offence    += rating.Offence;
            ratings.Defence    += rating.Defence;
            RatingsHt[teamCode] = ratings;
        }
예제 #5
0
        private void UpdateRating(string teamCode, UnitRatings.UnitRating unitRating, string rating)
        {
            var ur = new UnitRatings();

            if (RatingsHt.ContainsKey(teamCode))
            {
                ur = ( UnitRatings )RatingsHt[teamCode];
            }
            else
            {
                RatingsHt.Add(teamCode, ur);
            }

            switch (unitRating)
            {
            case UnitRatings.UnitRating.Po:
                ur.PassOffence = rating;
                break;

            case UnitRatings.UnitRating.Ro:
                ur.RushOffence = rating;
                break;

            case UnitRatings.UnitRating.Pp:
                ur.PassProtection = rating;
                break;

            case UnitRatings.UnitRating.Pr:
                ur.PassRush = rating;
                break;

            case UnitRatings.UnitRating.Rd:
                ur.RunDefence = rating;
                break;

            case UnitRatings.UnitRating.Pd:
                ur.PassDefence = rating;
                break;
            }
            RatingsHt[teamCode] = ur;
        }
예제 #6
0
        private void LoadRatings(DateTime when)
        {
            // load the ratings into RatingsHt for a particular date
            var ds = Utility.TflWs.GetUnitRatings(when);
            var dt = ds.Tables["uratings"];

            foreach (DataRow dr in dt.Rows)
            {
                var teamCode = dr["TEAMCODE"].ToString();
                var ratings  = new UnitRatings(dr["RATINGS"].ToString());
                if (RatingsHt.ContainsKey(teamCode))
                {
                    RatingsHt[teamCode] = ratings;
                }
                else
                {
                    RatingsHt.Add(teamCode, ratings);
                }
            }
            LastDateRanked = when;
        }