Пример #1
0
 public FriendsToMatch(User i_User, IEnumerable <User> i_Friends, LinkedList <ChainOfHandlers.eFilters> i_ListOfOptionalFilters, int i_Score)
 {
     r_User    = i_User;
     r_Friends = i_Friends;
     r_ChainOfHandlersEntry = ChainOfHandlers.Build(i_ListOfOptionalFilters);
     r_Score = Math.Min(i_Score, i_ListOfOptionalFilters.Count);
 }
Пример #2
0
        public static FriendFilter Build(LinkedList <eFilters> i_ListOfOptionalFiltersToAdd)
        {
            FriendFilter firstInChain = null;

            foreach (IFilterStrategy criticalFilterTest in sr_CriticalFilterTests)
            {
                if (firstInChain == null)
                {
                    firstInChain = new CriticalFilter(criticalFilterTest);
                }
                else
                {
                    firstInChain.AddToEndOfChain(new CriticalFilter(criticalFilterTest));
                }
            }

            foreach (eFilters nameOfOptionalFilter in i_ListOfOptionalFiltersToAdd)
            {
                IFilterStrategy optionalFilterTest = sr_StringToOptionalFilterTest[nameOfOptionalFilter];

                if (firstInChain == null)
                {
                    firstInChain = new OptionalFilter(optionalFilterTest);
                }
                else
                {
                    firstInChain.AddToEndOfChain(new OptionalFilter(optionalFilterTest));
                }
            }

            return(firstInChain);
        }