Example #1
0
        public Card Pop(PilePosition position)
        {
            if (IsEmpty)
            {
                throw new InvalidOperationException("This pile is empty");
            }

            return(position.Pop(this));
        }
Example #2
0
        public List <Card> Pop(PilePosition position, int count)
        {
            if (count <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(count));
            }

            if (IsEmpty)
            {
                throw new InvalidOperationException("This pile is empty");
            }

            return(position.Pop(this, count));
        }