Ejemplo n.º 1
0
 public void Merge(RaceSelection other)
 {
     for (int i = 0; i < other.Count; ++i)
     {
         AddHorse(other.Get(i));
     }
 }
Ejemplo n.º 2
0
        public RaceSelection MakeDeepCopy()
        {
            RaceSelection rc = new RaceSelection();

            for (int i = 0; i < _selection.Count; ++i)
            {
                rc._selection.Add(_selection[i]);
            }

            for (int i = 0; i < _markedHorses.Count; ++i)
            {
                rc._markedHorses.Add(_markedHorses[i]);
            }

            return rc;
        }
Ejemplo n.º 3
0
        public bool IsIdentical(RaceSelection other)
        {
            _selection.Sort();
            other._selection.Sort();

            if (_selection.Count != other._selection.Count)
            {
                return false;
            }

            for (int i = 0; i < _selection.Count; ++i)
            {
                if ((int)_selection[i] != (int)other._selection[i])
                {
                    return false;
                }
            }

            return true;
        }
Ejemplo n.º 4
0
        public bool IsMatching(RaceSelection other)
        {
            for (int i = 0; i < other._selection.Count; ++i)
            {
                int horse = (int) other._selection[i];

                if (_markedHorses.Contains(horse))
                {
                    return true;
                }
            }

            return false;
        }
Ejemplo n.º 5
0
        public void CloneValues(Limitation other)
        {
            Debug.Assert(NumberOfRaces == other.NumberOfRaces);

            _firstRace = other._firstRace;
            for (int i = 0; i < NumberOfRaces; ++i)
            {
                RaceSelection ors = other.GetRaceSelection(i);

                RaceSelection rs = new RaceSelection();

                for (int j = 0; j < ors.Count; ++j)
                {
                    rs.AddHorse(ors.Get(j));
                }

                _selection[i] = rs;
            }

            _minMatches = 0;
            _maxMatches = NumberOfRaces;
        }