Ejemplo n.º 1
0
        public void Load(string filename)
        {
            StreamReader sr = new StreamReader(filename);

            List<ParsableText> txt = new List<ParsableText>();

            string line;
            while ((line = sr.ReadLine()) != null)
            {
                txt.Add(new ParsableText(line));

            }
            sr.Close();

            Race currentRace = null;

            foreach (ParsableText p in txt)
            {
                Horse horse = new Horse(p);

                if ((currentRace == null) || (horse.RaceNumber != currentRace.RaceNumber))
                {
                    Race race = new Race(horse.RaceNumber);
                    currentRace = race;
                    _race.Add(race);
                }

                currentRace.Add(horse);

            }
        }
Ejemplo n.º 2
0
 public void Add(Horse horse)
 {
     if (!horse.WasScratched)
     {
         _horse.Add(horse);
     }
 }