Ejemplo n.º 1
0
        public static Distance FindDistanceInfo(double distanceInYards, string surface)
        {
            Distance.TrackType trackType = Distance.TrackType.OuterTrack;

            if (surface.Trim()[0] == 'd' || surface.Trim()[0] == 't')
            {
                trackType = Distance.TrackType.InnerTrack;
            }

            Distance temp = new Distance(distanceInYards, trackType, Distance.FractionType.Third, Distance.FractionType.Third);
            foreach (Distance d in _distance)
            {

                if (Distance.AreEqual(temp, d))
                {
                    return d;
                }
            }

            return null;
        }
Ejemplo n.º 2
0
 private RaceInfo(int id, string stateBredFlag, string ageSexRestriction, int num, double distance, string abbrRaceClass, double firstCallTime, double secondCallTime, double finalTime, string surface, double maxClaimingPrice, string trackCode, int year, int month, int day, Distance ds)
 {
     stateBredFlag += " ";
     ageSexRestriction += "   ";
     _raceNumber = num;
     _raceID = id;
     _distance = distance;
     _eqbRaceType = abbrRaceClass;
     _firstCallTime = firstCallTime;
     _secondCallTime = secondCallTime;
     _finalTime = finalTime;
     _surface = surface;
     _maxClaimingPrice = maxClaimingPrice;
     _trackCode = trackCode;
     _year = year;
     _month = month;
     _day = day;
     _ds = ds;
     _isStateBred = stateBredFlag[0] == 'S';
     _femaleOnly = ageSexRestriction[2] == 'F' || ageSexRestriction[2] == 'M';
     _twoYearsOnly = ageSexRestriction[0] == 'A';
     _threeYearsOnly = ageSexRestriction[0] == 'B';
 }
Ejemplo n.º 3
0
 public static bool AreEqual(Distance d1, Distance d2)
 {
     return (d1._distance == d2._distance) && (d1._tt == d2._tt);
 }
Ejemplo n.º 4
0
 static double CorrespondingCall(double f1, double f2, double f3, double f4, double f5, Distance.FractionType ft)
 {
     switch (ft)
     {
         case Distance.FractionType.First:
             return f1;
         case Distance.FractionType.Second:
             return f2;
         case Distance.FractionType.Third:
             return f3;
         case Distance.FractionType.Fourth:
             return f4;
         case Distance.FractionType.Fifth:
             return f5;
         default:
             return -1.0;
     }
 }