public int Discard(IDiscardPile discard) { var count = this.Count; discard.Add(this); this.Clear(); return(count); }
public void Recycle(IDiscardPile discardPile) { if (!IsEmpty) { throw new InvalidOperationException("Cannot recycle pile if not empty"); } Add(discardPile.Cards.Shuffle()); discardPile.Clear(); }
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; }