Ejemplo n.º 1
0
 public TrifectaSubsystem(TrifectaSubsystem other)
     : this()
 {
     this._payoff = other._payoff;
     this._amountToDutch = other._amountToDutch;
     foreach(KeyValuePair<Position, List<int>> pair in other._selection)
     {
         Position otherPosition = pair.Key;
         List<int> otherList = pair.Value;
         List<int> thisList = _selection[otherPosition];
         thisList.Clear();
         foreach (int i in otherList)
         {
             thisList.Add(i);
         }
     }
 }
Ejemplo n.º 2
0
        private bool IsPositionContained(Position pos, TrifectaSubsystem other)
        {
            List<int> thisList = _selection[pos];
            List<int> otherList = other._selection[pos];

            foreach (int i in otherList)
            {
                if (false == thisList.Contains(i))
                {
                    return false;
                }
            }

            return true;
        }
Ejemplo n.º 3
0
        private bool ArePositionsIdentical(Position pos, TrifectaSubsystem other)
        {
            List<int> list1 = this._selection[pos];
            List<int> list2 = other._selection[pos];

            if (list1.Count != list2.Count)
            {
                return false;
            }

            foreach (int i in list1)
            {
                if (false == list2.Contains(i))
                {
                    return false;
                }
            }
            return true;
        }
Ejemplo n.º 4
0
 public void Merge(TrifectaSubsystem other)
 {
     for (Position p = Position.First; p <= Position.Third; ++p)
     {
         foreach (int n in other._selection[p])
         {
             AddHorseToSpecificPosition(p, n);
         }
     }
 }
Ejemplo n.º 5
0
        public bool IsASuperset(TrifectaSubsystem other)
        {
            for (Position p = Position.First; p <= Position.Third; ++p)
            {
                if (!IsPositionContained(p, other))
                {
                    return false;
                }
            }

            return true;
        }
Ejemplo n.º 6
0
        public int CountUnmatchedRaces(TrifectaSubsystem other)
        {
            int countDescrepancies = 0;

            for (Position p = Position.First; p <= Position.Third; ++p )
            {
                if (!ArePositionsIdentical(p, other))
                {
                    ++countDescrepancies;
                }
            }
            return countDescrepancies;
        }