Пример #1
0
        public void ReshuffleFirstObjects(IDeckDict <D> thisList, int startAt, int endAt)
        {
            CheckRandom();
            int x = 0;
            int index;
            int ask1;

            endAt = endAt - thisList.Count + 1;
            int increasedEnd = 0;

            thisList.ForEach(items =>
            {
                index = _privateDict.IndexOf(items);
                if (index <= endAt)
                {
                    increasedEnd++;
                }
            });
            endAt += increasedEnd;
            thisList.ForEach(items =>
            {
                index = _privateDict.IndexOf(items);
                if (index == -1)
                {
                    throw new BasicBlankException("Item not found to reshuffle the card");
                }
                if (index < startAt || index > endAt)
                {
                    ask1 = _rs !.GetRandomNumber(endAt, startAt);
                    _privateDict.MoveItem(items, ask1);
                }
                x++;
                endAt--;
            });
        }