diff options
Diffstat (limited to 'mock/jrummikub/model')
-rw-r--r-- | mock/jrummikub/model/MockHand.java | 11 | ||||
-rw-r--r-- | mock/jrummikub/model/MockTable.java | 5 |
2 files changed, 11 insertions, 5 deletions
diff --git a/mock/jrummikub/model/MockHand.java b/mock/jrummikub/model/MockHand.java index 994f7f5..f8388d0 100644 --- a/mock/jrummikub/model/MockHand.java +++ b/mock/jrummikub/model/MockHand.java @@ -1,8 +1,10 @@ package jrummikub.model; import java.util.ArrayList; +import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Set; import jrummikub.util.Pair; @@ -10,6 +12,8 @@ public class MockHand implements IHand { public List<Pair<Stone, Position>> stones = new ArrayList<Pair<Stone, Position>>(); + public Set<Stone> pickups = new HashSet<Stone>(); + public Iterable<Pair<Stone, Position>> iterable; @Override @@ -29,13 +33,16 @@ public class MockHand implements IHand { } @Override - public void pickUp(Stone object) { - List<Pair<Stone, Position>> itList = new ArrayList(stones); + public boolean pickUp(Stone object) { + List<Pair<Stone, Position>> itList = new ArrayList<Pair<Stone, Position>>(stones); for (Pair<Stone, Position> entry : itList) { if (entry.getFirst() == object) { stones.remove(entry); + pickups.add(object); + return true; } } + return false; } @Override diff --git a/mock/jrummikub/model/MockTable.java b/mock/jrummikub/model/MockTable.java index 0bbbe0a..f17e5df 100644 --- a/mock/jrummikub/model/MockTable.java +++ b/mock/jrummikub/model/MockTable.java @@ -43,9 +43,8 @@ public class MockTable implements ITable { } @Override - public void pickUp(StoneSet object) { - // TODO Auto-generated method stub - + public boolean pickUp(StoneSet object) { + return false; } @Override |