internal void DoPlayTreasures(PlayerState currentPlayer) { currentPlayer.playPhase = PlayPhase.PlayTreasure; while (true) { Card cardTypeToPlay = currentPlayer.actions.GetTreasureFromHandToPlay(this, acceptableCard => true, isOptional:true); if (cardTypeToPlay == null) { break; } Card currentCard = currentPlayer.RemoveCardFromHand(cardTypeToPlay); if (currentCard == null) { throw new Exception("Player tried to remove a card that wasn't available in hand"); } currentPlayer.DoPlayTreasure(currentCard, this); } }
internal Card DoPlayOneTreasure(PlayerState currentPlayer) { Card cardTypeToPlay = currentPlayer.actions.GetTreasureFromHandToPlay(this, acceptableCard => true, isOptional: true); if (cardTypeToPlay == null) { return null; } Card currentCard = currentPlayer.RemoveCardFromHand(cardTypeToPlay); if (currentCard == null) { throw new Exception("Player tried to remove a card that wasn't available in hand"); } currentPlayer.DoPlayTreasure(currentCard, this); return cardTypeToPlay; }