View Single Post
Old 08-10-2005, 04:36 PM   #2 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
Notice that you may have to learn the ways of virtual methods.

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

And a Deck is nothing but a collection of 52 Cards.
So you need only two classes:
- Card
- Deck
Once you have the Deck defined, just instantiate an array or vector of Decks. And then transfer the cards from one deck to the other. This way you don't have to mess with inherritance at all.

If you do it with inherritance as you do now, you are basically saying:
Quote:
An ExPile (and a TopPile) are special Decks!
But that's not true! They are Decks, although they may be not complete. But that has nothing to do with design. I'll try to get my system up and running as fast as I can but it won't be tomorrow because I need to carry more stuff to help someone else move to another home. I just bought his home.
__________________

Last edited by Valmont; 08-10-2005 at 07:22 PM.
Valmont is offline   Reply With Quote