man kann speichern und laden, nur nicht während eines laufenden spiels laden

git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@386 72836036-5685-4462-b002-a69064685172
This commit is contained in:
Ida Massow 2011-06-08 16:29:13 +02:00
parent ce1b716e12
commit 3ff911ab93
10 changed files with 258 additions and 47 deletions

View file

@ -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));
}
/**

View file

@ -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 */