Example #1
0
        internal static bool TryConstruct(cSequenceSets pSequenceSets, int pAsterisk, bool pDistinct, out cUIntList rResult)
        {
            if (pSequenceSets == null)
            {
                throw new ArgumentNullException(nameof(pSequenceSets));
            }

            rResult = new cUIntList();

            foreach (var lSequenceSet in pSequenceSets)
            {
                if (lSequenceSet == null)
                {
                    return(false);
                }
                if (!ZExpand(lSequenceSet, pAsterisk, out var lResult))
                {
                    return(false);
                }
                rResult.AddRange(lResult);
            }

            if (pDistinct)
            {
                rResult = new cUIntList(rResult.Distinct());
            }
            return(true);
        }
Example #2
0
 internal static bool TryConstruct(cSequenceSet pSequenceSet, int pAsterisk, bool pDistinct, out cUIntList rResult)
 {
     if (pSequenceSet == null)
     {
         throw new ArgumentNullException(nameof(pSequenceSet));
     }
     if (!ZExpand(pSequenceSet, pAsterisk, out rResult))
     {
         return(false);
     }
     if (pDistinct)
     {
         rResult = new cUIntList(rResult.Distinct());
     }
     return(true);
 }