Yeek!

I've been way too busy; I've just now had time to really look through your replies. First of all, thanks so much for taking the time to put in that code! It's greatly appreciated, and I'll probably reference it at some point for design solutions.
Also, thanks for the suggestion to learn virtual methods...I've just read the 'virtual functions and polymorphism' chapter in one of my books and they look to be exactly what I need for this.
And thanks for bringing this up:
Quote:
But most importantly, you misunderstood the concept of "type" probably.
You see, the cards you draw, put back, put on a spot, they are all contained withing the same type: Deck
|
I sort of wondered about this as I wrote up my general design...My base class Pile pretty much *is* the Deck class; it has most of the functions and variables as your Deck. The reason I decided to write different classes for the different types of piles was more for organization than anything else. I saw the various piles as special or different decks because the behave pretty differently.
Basically, my thought process was: I realize I could write everything as simply a Deck, but then how would I determine what type of Deck it was? Well, I could simply add a variable that tells me. But then how would I control the behavior of the different kinds of Decks? (Since they behave quite differently...especially in my version of Solitaire.

) Each function would have to have a mess of if statements, determining how the Deck should behave depending on that variable.
But that seemed like it would be less elegant than just seperating the Decks into different classes. Now, I'm quite a newb; is there a better way than that ^ to organize this when there's only one Deck class?
Thanks a bunch!
-Stacy