public void Merge(RaceSelection other) { for (int i = 0; i < other.Count; ++i) { AddHorse(other.Get(i)); } }
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; }
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; }
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; }
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; }