From 244abb7e7320355d0c4aad4a7ba267f11d358563 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 7 Jun 2011 16:59:06 +0200 Subject: Make model fully serializable git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@381 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/model/Table.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/jrummikub/model/Table.java') diff --git a/src/jrummikub/model/Table.java b/src/jrummikub/model/Table.java index 1ac31a9..1f07f97 100644 --- a/src/jrummikub/model/Table.java +++ b/src/jrummikub/model/Table.java @@ -5,6 +5,8 @@ import jrummikub.util.Pair; /** Class administering the {@link Stone}s on the game-Table */ public class Table extends StoneTray implements ITable { + private static final long serialVersionUID = 2433091681355019937L; + private GameSettings gameSettings; private static class StoneInfo { @@ -23,7 +25,7 @@ public class Table extends StoneTray implements ITable { * Constructor for a table * * @param settings - * GameSettings + * GameSettings */ public Table(GameSettings settings) { gameSettings = settings; @@ -33,7 +35,7 @@ public class Table extends StoneTray implements ITable { * Removes {@link Stone} from the Table * * @param stone - * stone to pick up + * stone to pick up */ @Override public void pickUpStone(Stone stone) { @@ -84,8 +86,7 @@ public class Table extends StoneTray implements ITable { pickUp(set); Pair firstSplit = set.splitAt(stonePosition); - Pair secondSplit = firstSplit.getSecond() - .splitAt(1); + Pair secondSplit = firstSplit.getSecond().splitAt(1); StoneSet leftSet = firstSplit.getFirst(); StoneSet rightSet = secondSplit.getSecond(); @@ -93,8 +94,8 @@ public class Table extends StoneTray implements ITable { if (set.classify(gameSettings).getFirst() == StoneSet.Type.RUN) { Position leftPosition, rightPosition; leftPosition = setPosition; - rightPosition = new Position( - setPosition.getX() + stonePosition + 1, setPosition.getY()); + rightPosition = new Position(setPosition.getX() + stonePosition + 1, + setPosition.getY()); drop(leftSet, leftPosition); drop(rightSet, rightPosition); -- cgit v1.2.3