Пример #1
0
        public int Discard(IDiscardPile discard)
        {
            var count = this.Count;

            discard.Add(this);
            this.Clear();
            return(count);
        }
Пример #2
0
 public void Recycle(IDiscardPile discardPile)
 {
     if (!IsEmpty)
     {
         throw new InvalidOperationException("Cannot recycle pile if not empty");
     }
     Add(discardPile.Cards.Shuffle());
     discardPile.Clear();
 }
Пример #3
0
    public Board(IActiveCards active, IDrawPile draw, IDiscardPile discard, IHand hand)
    {
        if (hand == null)
        {
            throw new ArgumentNullException("hand");
        }
        if (draw == null)
        {
            throw new ArgumentNullException("draw");
        }
        if (active == null)
        {
            throw new ArgumentNullException("active");
        }
        if (discard == null)
        {
            throw new ArgumentNullException("discard");
        }

        this.hand        = hand;
        this.drawPile    = draw;
        this.activeCards = active;
        this.discardPile = discard;
    }