DiscardHand() private method

private DiscardHand ( GameState gameState ) : void
gameState GameState
return void
Esempio n. 1
0
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            // Choose one: ...
            PlayerActionChoice actionChoice = currentPlayer.RequestPlayerChooseBetween(
                gameState,
                acceptableChoice => acceptableChoice == PlayerActionChoice.Discard || acceptableChoice == PlayerActionChoice.PlusCoin);

            PlayerState.AttackAction attackAction = this.DoEmptyAttack;

            if (actionChoice == PlayerActionChoice.PlusCoin)
            {
                // +2 coin;
                currentPlayer.AddCoins(2);
            }
            else
            {
                // discard your hand,
                currentPlayer.DiscardHand(gameState);
                // +4 cards
                currentPlayer.DrawAdditionalCardsIntoHand(4);

                attackAction = this.DoSpecializedAttackInternal;
            }

            currentPlayer.AttackOtherPlayers(gameState, attackAction);
        }
Esempio n. 2
0
 private void DoSpecializedAttackInternal(PlayerState currentPlayer, PlayerState otherPlayer, GameState gameState)
 {
     // with at least 5 cards in hand
     if (otherPlayer.hand.Count >= 5)
     {
         // discards his hand
         otherPlayer.DiscardHand(gameState);
         // and draws 4 cards
         otherPlayer.DrawAdditionalCardsIntoHand(4);
     }
 }
Esempio n. 3
0
 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     if (currentPlayer.hand.Any)
     {
         currentPlayer.DiscardHand(gameState);
         currentPlayer.actionsToExecuteAtBeginningOfNextTurn.Add(DelayedAction);
     }
 }