v2.0
As there is a significant amount of changes, the tag version jumps from 1.x to 2.x, so it alerts that it is not a simple "fixing-bugs release".
The main change in this new release is the game's programming approach. As the program is based in OOP, there was some not-logical thoughts of how the game had to be run. They worked but, with this new release, the game is better, uses less code and is more readable.
There is still a lot to do, but it's a start.
Before:
- I used to have a bunch of boolean variables as not-static fields inside the
Card
class. Accessing them, I could know if aCard
had to be thrown, or if it was taken, etc. - To make a Player take a card from the deck, I had to choose a random card from it.
Now:
- The cards are simply moved to different lists of cards while executing the game. They move from
deck
toinHandCards
and towonCards
. There is no need of having those booleans anymore. - I shuffle them in the constructor, and it just takes the one on top, as in real life.
Also:
I added roundThrown
as a field of Card
, to know in which round the card participates, I improved a couple of methods and modified some comments and I did some other basic stuff.