diff options
Diffstat (limited to 'src/jrummikub/model')
-rw-r--r-- | src/jrummikub/model/StoneSet.java | 9 | ||||
-rw-r--r-- | src/jrummikub/model/StoneTray.java | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/jrummikub/model/StoneSet.java b/src/jrummikub/model/StoneSet.java index 0d53b52..1bb0823 100644 --- a/src/jrummikub/model/StoneSet.java +++ b/src/jrummikub/model/StoneSet.java @@ -1,5 +1,6 @@ package jrummikub.model; +import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; @@ -11,10 +12,12 @@ import jrummikub.util.Pair; import static jrummikub.model.StoneSet.Type.*; /** Class managing {@link Stone}s joined together to form sets */ -public class StoneSet implements Iterable<Stone>, Sizeable { +public class StoneSet implements Iterable<Stone>, Sizeable, Serializable { + private static final long serialVersionUID = -3852631195648599398L; + static final float VERTICAL_BORDER = 0.5f; static final float HORIZONTAL_BORDER = 0.125f; - private List<Stone> stones; + private ArrayList<Stone> stones; /** * Create a new single stone stone set @@ -23,7 +26,7 @@ public class StoneSet implements Iterable<Stone>, Sizeable { * single stone of the set */ public StoneSet(Stone stone) { - stones = Collections.singletonList(stone); + stones = new ArrayList<Stone>(Collections.singletonList(stone)); } /** diff --git a/src/jrummikub/model/StoneTray.java b/src/jrummikub/model/StoneTray.java index b0a824d..8806b1c 100644 --- a/src/jrummikub/model/StoneTray.java +++ b/src/jrummikub/model/StoneTray.java @@ -13,8 +13,9 @@ import jrummikub.util.Pair; * @param <E> * Type of positioned objects (must implement Sizeable) */ -@SuppressWarnings("serial") public class StoneTray<E extends Sizeable> implements IStoneTray<E> { + private static final long serialVersionUID = -6329309928640027222L; + protected HashMap<E, Pair<E, Position>> objects = new HashMap<E, Pair<E, Position>>(); /** Possible move directions in case of overlapping Stones/Sets */ |