Exemple #1
0
 public void PlayCardOnStack(Player player, Card card, OpenStackOfCards stack)
 {
     if (stack.CanAddCard(card))
     {
         stack.AddCard(player.PlayOpenCard(card));
     }
 }
Exemple #2
0
        private void Initialize()
        {
            Deck = StackOfCards.CreateFullDeckOfCards();
            Deck.Shuffle();

            LeftStack  = new OpenStackOfCards();
            RightStack = new OpenStackOfCards();

            PlayerOne = null;
            PlayerTwo = null;
        }
Exemple #3
0
        /// <summary>
        /// Restarts the game with the same players
        /// </summary>
        public void RestartGame()
        {
            Deck = StackOfCards.CreateFullDeckOfCards();
            Deck.Shuffle();

            LeftStack  = new OpenStackOfCards();
            RightStack = new OpenStackOfCards();

            // todo: ugly
            var playerOneName = PlayerOne.NickName;
            var playerTwoName = PlayerTwo.NickName;

            PlayerOne = null;
            PlayerTwo = null;

            AddPlayer(playerOneName);
            AddPlayer(playerTwoName);
        }