void Reverse_Deck(Game* x){
// would i refer to the deck52 elements like this??
x->deck52[0]; // for example
}
1.) I am planning forthis program to use three different decks, each is a class
of its own.
2.) Each will have several games for that particular deck of cards.
a.) Do you think it would be good style to write each game as a class of its own,
or to write one Game classfor a perticular Deck_Size??
( each game using that deck would become a member function)
I am thinking, each deck should stay a class of its own, and each game using that class
should be a derived class from that Deck. Is this good??
Thank You everyone ...
Put the code you need help with here.
What is the point of the card class? Is it complex enough to justify its existence? If it had an image/ graphics, maybe. If its just a pair of integers (a 'suit' and a 'value') then not really. Perhaps a deck of cards itself is a low enough level 'thing' to serve as your basis. Depends on what you are doing and what your wants & needs are which way you go. There are at lest 3 sensible designs... 1) a card class where a deck is a container like a <vector>, 2) a deck class that is unaware of 'cards' (implicit, not explicit, cards, in other words), and 3) as you said, card class and deck class all built by you.. I favor 1 and 2 but not 3; 3 is more work than 1 or 2 so it should be the last choice. 1 and 2 depend on what you need done. 1 has a lot going for it, as you can shuffle a vector, etc...
not all card games have 52 sized decks. (jokers, for example, add 2 more, and what about uno?).
you can overload the [] operator of your 'deck' class to refer to one card. We can show you this once you need to see it, we don't have enough code here to fool with it right now. This is just syntax you may not know, nothing special here, focus on design and let the details like this slide for now, knowing it can be done.