View Single Post
Old 05-05-2004, 11:39 AM   #9 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
Quote:
Originally posted by dirs
Thanks for the help so far and taking interest in the problem!!
The base class card defines the basic functions in any card game e.g. shuffling the cards, dealing the cards to the players.
Any card game uses these basic functions and also it has its own functions to implement the different rules it have.
AAAAH. You should have told me this before! I just made this new image. I wasn' finished yet .
Anyway here is the image:


But this one doesn't satisfy. But it is much better to start with so you can see how "cards" "Players" and the actual game "black jack" are NOT related!
I need a ciggy right now. I'll be back reeeal soon. But in the mean time, see if you can split "my" BlackJack class so "Deal" and "Shuffle" belongs to any card game.
So Make a baseclass called "ICardGame" and derive class "BlackJack" fromt that class.
The "I" stands for interface.
What you have to think about is that the way you deal for the Black Jack game differs, then the way you deal for lets say a Poker game.
But the way you Shuffle the cards could be the same.
I don't know these games.
So make "void Deal()" a pure virtual method in "ICardGame"!

I am having a tea and a cig now . Good luck!
brb
__________________
Valmont is offline   Reply With Quote