Пример #1
0
        public override Permutation InsertLetter(int letter)
        {
            int              maximum;
            bool             lettersIncreased = false;
            NumSequenceBasic newNumSequenceBasic;

            if (Maximum >= letter)
            {
                maximum          = Maximum + 1;
                lettersIncreased = true;
            }
            else
            {
                maximum = letter;
            }

            NumSequenceBasic numSequenceBasicTemp = NumSequenceBasic.InsertLetter(NumSequenceBasic.Length, letter);

            if (lettersIncreased)
            {
                newNumSequenceBasic = IncreaseHigherLetters(numSequenceBasicTemp, letter,
                                                            numSequenceBasicTemp.Length - 1);
            }
            else
            {
                newNumSequenceBasic = numSequenceBasicTemp;
            }

            return(patternFactory.GetPattern(newNumSequenceBasic, HighestPosition + 1,
                                             maximum));
        }
 protected override Permutation ConstructPattern(NumSequenceBasic numSequenceBasic, int highestPosition, int maximum)
 {
     return(patternFactory.GetPattern(numSequenceBasic, highestPosition, maximum));
 }