A GUID is a Global Unique Identifier, a 128-bit(16-byte) 'number', which should be unique at all times(There are a lot of combinations to generate here, so the chance of getting a double value is quite small. But given enough time, you're bound to generate the same number).
I use it as a way to sort the cards, because I'm lazy :). Your ShuffleDeck() basically does what my IComparable / List.Sort() combination does. There is no need to sort the deck if you're going to shuffle manually btw, but there is no harm in it.
I see you're handling exceptions too, good job/idea. However, in this case, it might be better to have the function that calls DealCard deal with it.
Consider this extremely simplified (psuedo) program:
Deck deck = new Deck();// etc.while (!gameOver){ Options playerSelection = GetPlayerInput(); if (playerSelection == Options.TakeCard) { try { player.GiveCard(deck.DealCard()); } catch (ArgumentOutOfRangeException e) { ShowError("Oops! There are no more cards on the deck!"); } }}
In this case, you let the caller of DealCard handle the exception, instead of doing it inside the DealCard() function. Because if you do handle it inside the function, there is no way to find out something went wrong and you keep drawing invalid cards from the deck.
Good luck with learning. Perhaps, you should step a notch down from writing poker, to writing a more simpler game, such as GuessTheNumber:
Computer generates a random number, and player has to guess which number it is. If the guess is lower than the number, it will show "Higher" and when it's higher, it will show "Lower". If the guess equals the number, it will show "You won in x guesses", where x is the amount of attempts.
(Number = 60)
Guess? 50
Higher
Guess? 75
Lower
Guess? 63
Lower
Guess? 58
Higher
Guess? 60
You won in 5 guesses!
Toolmaker