diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-06-07 16:59:06 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-06-07 16:59:06 +0200 |
commit | 244abb7e7320355d0c4aad4a7ba267f11d358563 (patch) | |
tree | dd612c5022132d77a9b4f7f1c85f95ce83e2789a /src/jrummikub/model/Table.java | |
parent | af3661fea084df6e089c2597dc4b311c77f39e4f (diff) | |
download | JRummikub-244abb7e7320355d0c4aad4a7ba267f11d358563.tar JRummikub-244abb7e7320355d0c4aad4a7ba267f11d358563.zip |
Make model fully serializable
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@381 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/model/Table.java')
-rw-r--r-- | src/jrummikub/model/Table.java | 13 |
1 files changed, 7 insertions, 6 deletions
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<StoneSet> implements ITable { + private static final long serialVersionUID = 2433091681355019937L; + private GameSettings gameSettings; private static class StoneInfo { @@ -23,7 +25,7 @@ public class Table extends StoneTray<StoneSet> 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<StoneSet> 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<StoneSet> implements ITable { pickUp(set); Pair<StoneSet, StoneSet> firstSplit = set.splitAt(stonePosition); - Pair<StoneSet, StoneSet> secondSplit = firstSplit.getSecond() - .splitAt(1); + Pair<StoneSet, StoneSet> secondSplit = firstSplit.getSecond().splitAt(1); StoneSet leftSet = firstSplit.getFirst(); StoneSet rightSet = secondSplit.getSecond(); @@ -93,8 +94,8 @@ public class Table extends StoneTray<StoneSet> 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); |