/// <summary> /// /// </summary> /// <returns></returns> public Card GetCard() { Random rng = new Random(); int cardCount = deck.GetCardCount(); Card cardToReturn; //checks the count total to know if we return a random card, the last card or none if (cardCount > 2) { cardToReturn = deck.GetDeck()[rng.Next(1, cardCount)]; deck.GetDeck().Remove(cardToReturn); return(cardToReturn); } else if (cardCount == 1) { cardToReturn = deck.GetDeck()[1]; deck.GetDeck().Remove(cardToReturn); return(cardToReturn); } else { return(null); } }