Hi jidder,
I was asking if i had done it properly before making more to make sure i didn't have to redo them. |
I don't know how much of this you know already, but here goes.
I mentioned having the extra classes because it is important to try & get the concepts of class design right - which isn't always easy.
I try to think of things as real world objects - decide what duties & info each object needs to have.
In my mind, the contents of a Hand can be used to determine if the player wins or not, but the responsibility of the transfer of money doesn't belong with it.
You could have a Game class which controls the playing of the game, with the duties of dealing, deciding the winner, and transferring money. All the other classes just hold only the info & functions they need, so that everything is modularised & reusable, like this:
CPlayer & CDealer have FundsAvailable & the ScoreCurrentHand & Hit, Stick & Double functions;
CBank has FundsAvailable;
CGame has the functions Deal3Cards, Deal1Card, IsWinner, TransferMoney;
CBetPool has the BetTotal for the current hand.
The GenerateCard function is simple at this stage, & will need some modification especially for multi-player. You will probably need a proper CDeck class as well.
Hope all goes well :)