summaryrefslogtreecommitdiffstats
path: root/mock/jrummikub/model
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-06-19 00:14:27 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-06-19 00:14:27 +0200
commit479384d6bfeea0c225af829cbc1cac730d87c844 (patch)
treef9a1ef3b2e87c9179d482443a11e98581e660939 /mock/jrummikub/model
parente8549b95dff600aa173384a8f7bdbf0871ba9d47 (diff)
downloadJRummikub-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 'mock/jrummikub/model')
-rw-r--r--mock/jrummikub/model/MockHand.java11
-rw-r--r--mock/jrummikub/model/MockTable.java11
2 files changed, 22 insertions, 0 deletions
diff --git a/mock/jrummikub/model/MockHand.java b/mock/jrummikub/model/MockHand.java
index 13f6450..d282234 100644
--- a/mock/jrummikub/model/MockHand.java
+++ b/mock/jrummikub/model/MockHand.java
@@ -92,4 +92,15 @@ public class MockHand implements IHand {
public int getIdenticalStoneCount() {
return 0;
}
+
+ @Override
+ public boolean contains(Stone object) {
+ for (Pair<Stone, Position> stone : stones) {
+ if (stone.getFirst() == object) {
+ return true;
+ }
+ }
+
+ return false;
+ }
}
diff --git a/mock/jrummikub/model/MockTable.java b/mock/jrummikub/model/MockTable.java
index 295321c..77652a6 100644
--- a/mock/jrummikub/model/MockTable.java
+++ b/mock/jrummikub/model/MockTable.java
@@ -69,4 +69,15 @@ public class MockTable implements ITable {
return sets.size();
}
+ @Override
+ public boolean contains(StoneSet object) {
+ for (Pair<StoneSet, Position> set : sets) {
+ if (set.getFirst() == object) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
}