Esempio n. 1
0
        // TODO FlipCardUp does not do a check to see if it can be done, but relies on the state to check.
        // This action has a 'canMoveCards' check first though. Make this more consistent.
        public void MoveCards(int destStackIndex)
        {
            CardStack fromStack;
            CardStack subStack;
            CardStack destStack = columns[destStackIndex - 1].FaceUpStack;

            if (SelectedStackIndex == 0)
            {
                fromStack = drawStack;
            }
            else
            {
                fromStack = columns[SelectedStackIndex - 1].FaceUpStack;
            }

            subStack = fromStack.GetTopNCards(numCardsSelected);

            if (canMoveCards(subStack, destStack))
            {
                fromStack.RemoveRange(fromStack.Count - subStack.Count, subStack.Count);
                destStack.AddStack(subStack);
            }
        }