private void DoCleanupPhase(PlayerState currentPlayer) { currentPlayer.playPhase = PlayPhase.Cleanup; if (currentPlayer.ownsCardThatHasSpecializedCleanupAtStartOfCleanup) { currentPlayer.cardsInPlayAtBeginningOfCleanupPhase.CopyFrom(currentPlayer.cardsPlayed); foreach (Card cardInPlay in currentPlayer.cardsInPlayAtBeginningOfCleanupPhase) { cardInPlay.DoSpecializedCleanupAtStartOfCleanup(currentPlayer, this); } currentPlayer.cardsInPlayAtBeginningOfCleanupPhase.Clear(); } currentPlayer.CleanupCardsToDiscard(this); }
private void DoCleanupPhase(PlayerState currentPlayer) { currentPlayer.EnterPhase(PlayPhase.Cleanup); if (currentPlayer.ownsCardThatHasSpecializedCleanupAtStartOfCleanup) { currentPlayer.cardsInPlayAtBeginningOfCleanupPhase.CopyFrom(currentPlayer.cardsPlayed); foreach (Card cardInPlay in currentPlayer.cardsInPlayAtBeginningOfCleanupPhase) { this.cardContextStack.PushCardContext(currentPlayer, cardInPlay, CardContextReason.CardBeingCleanedUp); cardInPlay.DoSpecializedCleanupAtStartOfCleanup(currentPlayer, this); this.cardContextStack.Pop(); } currentPlayer.cardsInPlayAtBeginningOfCleanupPhase.Clear(); } currentPlayer.CleanupCardsToDiscard(this); }