public static void CheckValues() { /* Method allows to do a spot check if values are generated correctly. Sidenote: At first I passed in a deck to this method. However this would mess with that deck - setting cards in the decks card array to null by calling DrawCard() etc - so I changed it and the method now creates its own deck for testing purposes. */ Deck tempDeck = new Deck(); Console.WriteLine("A list of four randomly drawn cards and their values."); Card randomCard0 = tempDeck.DrawCard(); Card randomCard1 = tempDeck.DrawCard(); Card randomCard2 = tempDeck.DrawCard(); Card randomCard3 = tempDeck.DrawCard(); Console.WriteLine("{0} has a value of: {1}", randomCard0.GetFace(), randomCard0.GetValue()); Console.WriteLine("{0} has a value of: {1}", randomCard1.GetFace(), randomCard1.GetValue()); Console.WriteLine("{0} has a value of: {1}", randomCard2.GetFace(), randomCard2.GetValue()); Console.WriteLine("{0} has a value of: {1}", randomCard3.GetFace(), randomCard3.GetValue()); tempDeck = null; }
public static void DrawAllCards(Deck deck) { Console.WriteLine("A list of all randomly drawn cards in your deck:"); for (int i = 0; i < deck.Cards.Length; i++) { Console.WriteLine(deck.drawnCardsCounter + " " + deck.DrawCard().GetFace()); } }