Guidence on my design please..
I am planning to make a simple Yatchzee Game.
Basically, you roll 5 dice in your first turn. Then hold any number of dice as you wish, and roll the rest. And you do this step one more time.
With the 5 dice you rolled after 3 turns, you pick a slot from possible options ( 1's, 2's, 3 of A kind.. ) and get some point depending on the dice you have rolled.
I have already done something like this:
But everything is just in 2 classes, and it is really, really messed up.
I do not want any code, or tell me how to do this..
All I am asking is:
How would you think of classes?
A Dice class ?
A Dice Roller class ?
But what else ?
( When you click on the buttons, you get the point to the lower part. The upper part of the frame shows the possible points you can get with the rolled combination )
Re: Guidence on my design please..
A Dice class, which would handle how a single Dice rolls as well.
That would be pretty simple.
A Hand class (I think they're Hands in Yahtzee?) which would contain the 5 Dice, as well as handle which ones are being thrown, and the number of throws.
I'd have a ScoringRules class as an attribute of that which would have the logic. The Hand would pass the dice (or itself) into the rules and get a value back (points plus name maybe?). Would have to take into account what had already been scored, so probably need the Player in there as well, or at least their Scorecard.
Then you'd probably have a Game.
This is just off the top of my head.