Ejemplo n.º 1
0
        public static void startNextGame()
        {
            // take cards from dealer and players and add to discard pile
            TableDealer.reset();
            Players.ForEach(player => player.reset());

            // if active deck has less than shuttle trigger value,
            // reset discard deck and active deck
            if (ActiveDeck.getCount() < Settings.ActiveDeckReshuffleTarget)
            {
                ActiveDeck = new ActiveDeck();
                ActiveDeck.createDeck();
                updateActiveDeckCount();

                DiscardDeck = new DiscardDeck();
                updateDiscardDeckCount();
            }

            // reset game status
            GameStatus      = GameStatusEnum.InProgress;
            PlayerTurnIndex = 0;

            // retoggle visibility handlers
            DealerHandVisibility = Visibility.Hidden;

            NextGameControlsVisibility   = Visibility.Hidden;
            ActiveGameControlsVisibility = Visibility.Visible;

            // deal initial hand
            dealInititalHand();
        }
Ejemplo n.º 2
0
        public void InitializesActiveDeck_ReturnsVoid()
        {
            // Arrange
            ActiveDeck activeDeck = new ActiveDeck();

            // Act

            // Assert
            Assert.AreEqual(0, activeDeck.getCount());
        }
Ejemplo n.º 3
0
        public void Create52CardDeck_ReturnsVoid()
        {
            // Arrange
            ActiveDeck activeDeck = new ActiveDeck();

            // Act
            activeDeck.createDeck();

            // Assert
            Assert.AreEqual(52, activeDeck.getCount());
        }
Ejemplo n.º 4
0
        public void CreateMultipleDeck_ReturnsVoid()
        {
            // Arrange
            const int  NumberOfDecks = 3;
            ActiveDeck activeDeck    = new ActiveDeck();

            // Act
            activeDeck.createDeck(NumberOfDecks);

            // Assert
            Assert.AreEqual(52 * NumberOfDecks, activeDeck.getCount());
        }
Ejemplo n.º 5
0
 // Decks
 // ----------
 private static void updateActiveDeckCount()
 {
     ActiveDeckCount = ActiveDeck.getCount().ToString();
 }