Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Seperation of concerns for Card & associated classes

$
0
0
Hello all,

I'm currently trying to work out how many classes I need in order to effectively manage cards for a card game scenario such as Poker, BlackJack, GoFish etc.

My thoughts are that I would need:

- card class (enum of ranks & suits as demonstrated in Oracle Enum tutorial) <- Template class
- deck class (52 card arraylist with shuffle method) <- Constructor class
- deal class (handles how many cards to deal out to how many players, manages remaining cards) <- Management class

Would this be considered sufficient for handling the cards or is it still not 'doing what it says on the tin' enough?

Kind regards,

P-Juice.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>