From 3ff911ab930cb87f90307b9a82dafc4d0b5fe305 Mon Sep 17 00:00:00 2001 From: Ida Massow Date: Wed, 8 Jun 2011 16:29:13 +0200 Subject: =?UTF-8?q?man=20kann=20speichern=20und=20laden,=20nur=20nicht=20w?= =?UTF-8?q?=C3=A4hrend=20eines=20laufenden=20spiels=20laden?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@386 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/model/StoneSet.java | 9 ++++++--- src/jrummikub/model/StoneTray.java | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/jrummikub/model') 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, Sizeable { +public class StoneSet implements Iterable, Sizeable, Serializable { + private static final long serialVersionUID = -3852631195648599398L; + static final float VERTICAL_BORDER = 0.5f; static final float HORIZONTAL_BORDER = 0.125f; - private List stones; + private ArrayList stones; /** * Create a new single stone stone set @@ -23,7 +26,7 @@ public class StoneSet implements Iterable, Sizeable { * single stone of the set */ public StoneSet(Stone stone) { - stones = Collections.singletonList(stone); + stones = new ArrayList(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 * Type of positioned objects (must implement Sizeable) */ -@SuppressWarnings("serial") public class StoneTray implements IStoneTray { + private static final long serialVersionUID = -6329309928640027222L; + protected HashMap> objects = new HashMap>(); /** Possible move directions in case of overlapping Stones/Sets */ -- cgit v1.2.3