internal void DiscardCard(Card card, GameState gameState, DeckPlacement source) { this.cardBeingDiscarded.AddCardToTop(card); if (source != DeckPlacement.Deck) { this.gameLog.PlayerDiscardCard(this, card, source); this.gameLog.PushScope(); gameState.cardContextStack.PushCardContext(this, card, CardContextReason.CardBeingDiscarded); if (gameState.players.CurrentPlayer.PlayPhase != PlayPhase.Cleanup) { card.DoSpecializedDiscardNonCleanup(this, gameState); } if (source == DeckPlacement.Play) { card.DoSpecializedDiscardFromPlay(this, gameState); } gameState.cardContextStack.Pop(); this.gameLog.PopScope(); } Card cardBeingDiscarded = this.cardBeingDiscarded.DrawCardFromTop(); if (cardBeingDiscarded != null) { this.discard.AddCard(card); } }