From 433a0c3561eeaec96c23656a347e38e3a3602597 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 5 May 2011 13:16:46 +0200 Subject: Moved mock classes to separate source folder git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@142 72836036-5685-4462-b002-a69064685172 --- test/jrummikub/model/MockGameState.java | 54 ------------------------- test/jrummikub/model/MockHand.java | 54 ------------------------- test/jrummikub/model/MockPlayer.java | 26 ------------ test/jrummikub/model/MockTable.java | 70 --------------------------------- 4 files changed, 204 deletions(-) delete mode 100644 test/jrummikub/model/MockGameState.java delete mode 100644 test/jrummikub/model/MockHand.java delete mode 100644 test/jrummikub/model/MockPlayer.java delete mode 100644 test/jrummikub/model/MockTable.java (limited to 'test/jrummikub/model') diff --git a/test/jrummikub/model/MockGameState.java b/test/jrummikub/model/MockGameState.java deleted file mode 100644 index 102e9fb..0000000 --- a/test/jrummikub/model/MockGameState.java +++ /dev/null @@ -1,54 +0,0 @@ -package jrummikub.model; - -import java.awt.Color; -import java.util.ArrayList; -import java.util.List; - -public class MockGameState implements IGameState { - public MockTable table; - public List players; - public int activePlayer; - public StoneHeap gameHeap; - - public MockGameState() { - table = new MockTable(); - players = new ArrayList(); - players.add(new MockPlayer(Color.red)); - players.add(new MockPlayer(Color.yellow)); - players.add(new MockPlayer(Color.green)); - players.add(new MockPlayer(Color.black)); - activePlayer = 0; - gameHeap = new StoneHeap(); - } - - @Override - public ITable getTable() { - return table; - } - - @Override - public int getPlayerCount() { - return players.size(); - } - - @Override - public IPlayer getPlayer(int i) { - return players.get(i); - } - - /** Changes the activePlayer to the next {@link Player} in the list */ - @Override - public void nextPlayer() { - activePlayer = (activePlayer + 1) % players.size(); - } - - @Override - public IPlayer getActivePlayer() { - return players.get(activePlayer); - } - - @Override - public StoneHeap getGameHeap() { - return gameHeap; - } -} diff --git a/test/jrummikub/model/MockHand.java b/test/jrummikub/model/MockHand.java deleted file mode 100644 index 2132ff4..0000000 --- a/test/jrummikub/model/MockHand.java +++ /dev/null @@ -1,54 +0,0 @@ -package jrummikub.model; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import jrummikub.util.Pair; - -public class MockHand implements IHand { - - public List stones = new ArrayList(); - - public Iterable> iterable; - - @Override - public Stone pickUp(Position position) { - return null; - } - - @Override - public void drop(Stone object, Position position) { - stones.add(object); - } - - @Override - public Position getPosition(Stone object) { - // TODO Auto-generated method stub - return null; - } - - @Override - public void pickUp(Stone object) { - // TODO Auto-generated method stub - - } - - @Override - public int getSize() { - return stones.size(); - } - - @Override - public Iterator> iterator() { - return iterable.iterator(); - } - - public MockHand clone() { - try { - return (MockHand) super.clone(); - } catch (CloneNotSupportedException e) { - return null; - } - } -} diff --git a/test/jrummikub/model/MockPlayer.java b/test/jrummikub/model/MockPlayer.java deleted file mode 100644 index adb9d85..0000000 --- a/test/jrummikub/model/MockPlayer.java +++ /dev/null @@ -1,26 +0,0 @@ -package jrummikub.model; - -import java.awt.Color; - -public class MockPlayer implements IPlayer { - - public MockHand hand; - public Color color; - - // private String name; - - public MockPlayer(Color color) { - hand = new MockHand(); - this.color = color; - } - - @Override - public IHand getHand() { - return hand; - } - - @Override - public Color getColor() { - return color; - } -} diff --git a/test/jrummikub/model/MockTable.java b/test/jrummikub/model/MockTable.java deleted file mode 100644 index 4d7ef1a..0000000 --- a/test/jrummikub/model/MockTable.java +++ /dev/null @@ -1,70 +0,0 @@ -package jrummikub.model; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import jrummikub.util.Pair; - -public class MockTable implements ITable { - public Map findStoneSet = new HashMap(); - public boolean valid = false; - public MockTable clonedTable; - public List> sets = new ArrayList>(); - - @Override - public void pickUpStone(Stone stone) { - // TODO Auto-generated method stub - - } - - @Override - public boolean isValid() { - return valid; - } - - @Override - public StoneSet pickUp(Position position) { - // TODO Auto-generated method stub - return null; - } - - @Override - public void drop(StoneSet object, Position position) { - sets.add(new Pair(object, position)); - } - - @Override - public Position getPosition(StoneSet object) { - // TODO Auto-generated method stub - return null; - } - - @Override - public void pickUp(StoneSet object) { - // TODO Auto-generated method stub - - } - - @Override - public Iterator> iterator() { - return sets.iterator(); - } - - @Override - public StoneSet findStoneSet(Stone stone) { - return findStoneSet.get(stone); - } - - public MockTable clone() { - return clonedTable; - } - - @Override - public int getSize() { - return sets.size(); - } - -} -- cgit v1.2.3