public ListElement(long value, ListElement previousElement, ListElement nextElement)
 {
     this.value           = value;
     this.previousElement = previousElement;
     this.nextElement     = nextElement;
 }
        public void MovePositionsWithIncrement(int increment)
        {
            long[] newCards = new long[deckSize];

            ListElement currentListElement = firstListElement;

            if (isInTheOriginalOrientation)
            {
                for (long i = 0, k = 0; i < deckSize; i++, k = (k + increment) % deckSize)
                {
                    newCards[k] = currentListElement.value;

                    currentListElement = currentListElement.nextElement == null ? firstListElement : currentListElement.nextElement;
                }

                ListElement previousListElement = null;

                for (long i = 0; i < deckSize; i++)
                {
                    ListElement newListElement = new ListElement(newCards[i], previousListElement, null);

                    if (previousListElement == null)
                    {
                        this.firstListElement = newListElement;
                    }
                    else
                    {
                        previousListElement.nextElement = newListElement;
                    }

                    previousListElement = newListElement;
                }

                lastListElement = previousListElement;
            }
            else
            {
                for (long i = 0, k = 0; i < deckSize; i++, k = (k + increment) % deckSize)
                {
                    newCards[k] = currentListElement.value;

                    currentListElement = currentListElement.previousElement == null ? firstListElement : currentListElement.previousElement;
                }

                ListElement previousListElement = null;

                for (long i = 0; i < deckSize; i++)
                {
                    ListElement newListElement = new ListElement(newCards[i], null, previousListElement);

                    if (previousListElement == null)
                    {
                        this.firstListElement = newListElement;
                    }
                    else
                    {
                        previousListElement.previousElement = newListElement;
                    }

                    previousListElement = newListElement;
                }

                lastListElement = previousListElement;
            }
        }