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(); }
public void InitializesActiveDeck_ReturnsVoid() { // Arrange ActiveDeck activeDeck = new ActiveDeck(); // Act // Assert Assert.AreEqual(0, activeDeck.getCount()); }
public void Create52CardDeck_ReturnsVoid() { // Arrange ActiveDeck activeDeck = new ActiveDeck(); // Act activeDeck.createDeck(); // Assert Assert.AreEqual(52, activeDeck.getCount()); }
public void CreateMultipleDeck_ReturnsVoid() { // Arrange const int NumberOfDecks = 3; ActiveDeck activeDeck = new ActiveDeck(); // Act activeDeck.createDeck(NumberOfDecks); // Assert Assert.AreEqual(52 * NumberOfDecks, activeDeck.getCount()); }
// Decks // ---------- private static void updateActiveDeckCount() { ActiveDeckCount = ActiveDeck.getCount().ToString(); }