diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-06-19 00:14:27 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-06-19 00:14:27 +0200 |
commit | 479384d6bfeea0c225af829cbc1cac730d87c844 (patch) | |
tree | f9a1ef3b2e87c9179d482443a11e98581e660939 /src/jrummikub/model | |
parent | e8549b95dff600aa173384a8f7bdbf0871ba9d47 (diff) | |
download | JRummikub-479384d6bfeea0c225af829cbc1cac730d87c844.tar JRummikub-479384d6bfeea0c225af829cbc1cac730d87c844.zip |
Correctly show invalid sets
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@471 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/model')
-rw-r--r-- | src/jrummikub/model/IStoneTray.java | 2 | ||||
-rw-r--r-- | src/jrummikub/model/StoneTray.java | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/jrummikub/model/IStoneTray.java b/src/jrummikub/model/IStoneTray.java index d411c9e..437ecda 100644 --- a/src/jrummikub/model/IStoneTray.java +++ b/src/jrummikub/model/IStoneTray.java @@ -55,4 +55,6 @@ public interface IStoneTray<E extends Sizeable> extends */
public int getSize();
+ public boolean contains(E object);
+
}
\ No newline at end of file diff --git a/src/jrummikub/model/StoneTray.java b/src/jrummikub/model/StoneTray.java index aaedaad..9148934 100644 --- a/src/jrummikub/model/StoneTray.java +++ b/src/jrummikub/model/StoneTray.java @@ -189,7 +189,16 @@ public class StoneTray<E extends Sizeable> implements IStoneTray<E> { */ @Override public Position getPosition(E object) { - return objects.get(object).getSecond(); + Pair<E, Position> entry = objects.get(object); + if (entry == null) { + return null; + } + return entry.getSecond(); + } + + @Override + public boolean contains(E object) { + return objects.containsKey(objects); } @Override |