private RequestPlayerDiscardCardsFromHand ( |
||
gameState | ||
count | int | |
isOptional | bool | |
return | int |
private void DoNowAndAtStartOfTurn(PlayerState currentPlayer, GameState gameState) { currentPlayer.DrawAdditionalCardsIntoHand(2, gameState); currentPlayer.RequestPlayerDiscardCardsFromHand(gameState, 2, isOptional: false); }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { currentPlayer.RequestPlayerDiscardCardsFromHand(gameState, 3, isOptional: false); }
public override void DoSpecializedAttack(PlayerState currentPlayer, PlayerState otherPlayer, GameState gameState) { PlayerActionChoice playerChoice = otherPlayer.RequestPlayerChooseBetween( gameState, acceptableChoice => acceptableChoice == PlayerActionChoice.Discard || acceptableChoice == PlayerActionChoice.GainCard); switch (playerChoice) { case PlayerActionChoice.Discard: otherPlayer.RequestPlayerDiscardCardsFromHand(gameState, 2, isOptional: false); break; case PlayerActionChoice.GainCard: otherPlayer.GainCardFromSupply(Curse.card, gameState, DeckPlacement.Hand); break; default: throw new Exception("Invalid Choice"); } }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { int cardDiscardCount = currentPlayer.RequestPlayerDiscardCardsFromHand(gameState, int.MaxValue, isOptional: true); currentPlayer.AddCoins(cardDiscardCount); foreach (PlayerState otherPlayer in gameState.players.OtherPlayers) { PlayerActionChoice choice = otherPlayer.RequestPlayerChooseBetween(gameState, isValidChoice => isValidChoice == PlayerActionChoice.Discard || isValidChoice == PlayerActionChoice.Nothing); switch (choice) { case PlayerActionChoice.Discard: { int cardCount = otherPlayer.RequestPlayerDiscardCardsFromHand(gameState, 2, isOptional: false); if (cardCount == 2) { otherPlayer.DrawOneCardIntoHand(gameState); } break; } case PlayerActionChoice.Nothing: break; } } }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { PlayerActionChoice choice = currentPlayer.RequestPlayerChooseBetween(gameState, acceptableChoice => acceptableChoice == PlayerActionChoice.Discard || acceptableChoice == PlayerActionChoice.GainCard || acceptableChoice == PlayerActionChoice.TopDeck); switch (choice) { case PlayerActionChoice.Discard: currentPlayer.RequestPlayerDiscardCardsFromHand(gameState, 2, isOptional: false); break; case PlayerActionChoice.GainCard: currentPlayer.GainCardFromSupply(Cards.Copper, gameState); break; case PlayerActionChoice.TopDeck: currentPlayer.RequestPlayerTopDeckCardFromHand(gameState, acceptableCard => true, isOptional: false); break; } PlayerActionChoice choice2 = currentPlayer.RequestPlayerChooseBetween(gameState, acceptableChoice => acceptableChoice == PlayerActionChoice.PlusCoin || acceptableChoice == PlayerActionChoice.Trash || acceptableChoice == PlayerActionChoice.GainCard); switch (choice2) { case PlayerActionChoice.PlusCoin: currentPlayer.AddCoins(3); break; case PlayerActionChoice.Trash: currentPlayer.TrashHand(gameState); break; case PlayerActionChoice.GainCard: currentPlayer.GainCardFromSupply(Cards.Duchy, gameState); break; } }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { int discardedCount = currentPlayer.RequestPlayerDiscardCardsFromHand(gameState, currentPlayer.Hand.Count, isOptional:true); currentPlayer.DrawAdditionalCardsIntoHand(discardedCount); discardedCount = currentPlayer.RequestPlayerDiscardCardsFromHand(gameState, currentPlayer.Hand.Count, isOptional: true); currentPlayer.AddCoins(discardedCount); // TODO: How does the player know they are discarding for coins or for card? // throw new NotImplementedException(); }