diff options
Diffstat (limited to 'src/jrummikub/model')
-rw-r--r-- | src/jrummikub/model/StoneSet.java | 9 | ||||
-rw-r--r-- | src/jrummikub/model/Table.java | 6 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/jrummikub/model/StoneSet.java b/src/jrummikub/model/StoneSet.java index 3324565..39fb158 100644 --- a/src/jrummikub/model/StoneSet.java +++ b/src/jrummikub/model/StoneSet.java @@ -49,6 +49,9 @@ public class StoneSet implements Iterable<Stone>, Sizeable { /** * Test for rule conflict within the StoneSet * + * @param settings + * GameSettings + * * @return true when the set is valid according to the rules */ public boolean isValid(GameSettings settings) { @@ -59,6 +62,9 @@ public class StoneSet implements Iterable<Stone>, Sizeable { * Test for rule conflict within the StoneSet and determine whether the set * is a group or a run * + * @param settings + * GameSettings + * * @return GROUP or RUN for valid sets, INVALID otherwise */ @@ -80,7 +86,8 @@ public class StoneSet implements Iterable<Stone>, Sizeable { } else if (stones.size() > settings.getStoneColors().size()) { return new Pair<Type, Integer>( RUN, - (settings.getHighestValue() * (settings.getHighestValue() + 1)) + (settings.getHighestValue() * (settings + .getHighestValue() + 1)) / 2 - (stones.size() - settings.getHighestValue()) * (stones.size() - settings.getHighestValue() - 1) diff --git a/src/jrummikub/model/Table.java b/src/jrummikub/model/Table.java index 87c360c..1ac31a9 100644 --- a/src/jrummikub/model/Table.java +++ b/src/jrummikub/model/Table.java @@ -19,6 +19,12 @@ public class Table extends StoneTray<StoneSet> implements ITable { } } + /** + * Constructor for a table + * + * @param settings + * GameSettings + */ public Table(GameSettings settings) { gameSettings = settings; } |