ge0rg/gamemasterdice — pull request #2 by dpflug (2014-01-05 20:46:29+00:00)
Title: Subclass refactor

After I added the new dice set, a friend suggested that I take advantage of subclassing. I took that as a good excuse to learn more about Java and here's the result.

This turns DiceSet into an abstract class with a getDiceSet() method that returns whichever subclass is appropriate. 3D20 is implemented by DSADiceSet, FUDGE/Fate is implemented by FUDGEDiceSet, 1d2 by Coin, and everything else by StandardDiceSet.

It's relatively straightforward, but it does a little code complexity. Feel free to stick with whichever style you prefer.