summaryrefslogtreecommitdiffstats
path: root/mock/jrummikub/view
diff options
context:
space:
mode:
Diffstat (limited to 'mock/jrummikub/view')
-rw-r--r--mock/jrummikub/view/MockHandPanel.java42
-rw-r--r--mock/jrummikub/view/MockPlayerPanel.java39
-rw-r--r--mock/jrummikub/view/MockStoneCollectionPanel.java28
-rw-r--r--mock/jrummikub/view/MockTablePanel.java89
-rw-r--r--mock/jrummikub/view/MockView.java68
5 files changed, 266 insertions, 0 deletions
diff --git a/mock/jrummikub/view/MockHandPanel.java b/mock/jrummikub/view/MockHandPanel.java
new file mode 100644
index 0000000..4fdd58e
--- /dev/null
+++ b/mock/jrummikub/view/MockHandPanel.java
@@ -0,0 +1,42 @@
+package jrummikub.view;
+
+import jrummikub.model.Position;
+import jrummikub.model.Stone;
+import jrummikub.util.Event2;
+import jrummikub.util.IEvent1;
+import jrummikub.util.IEvent2;
+import jrummikub.util.Pair;
+
+public class MockHandPanel implements IHandPanel {
+ public Event2<Stone, Boolean> stoneClickEvent = new Event2<Stone, Boolean>();
+ public Iterable<Pair<Stone, Position>> stones;
+
+ @Override
+ public IEvent2<Stone, Boolean> getStoneClickEvent() {
+ return stoneClickEvent;
+ }
+
+ @Override
+ public IEvent2<Stone, Boolean> getRangeClickEvent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IEvent2<Stone, Boolean> getSetClickEvent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IEvent1<Position> getClickEvent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void setStones(Iterable<Pair<Stone, Position>> stones) {
+ this.stones = stones;
+ }
+
+}
diff --git a/mock/jrummikub/view/MockPlayerPanel.java b/mock/jrummikub/view/MockPlayerPanel.java
new file mode 100644
index 0000000..fcf560e
--- /dev/null
+++ b/mock/jrummikub/view/MockPlayerPanel.java
@@ -0,0 +1,39 @@
+package jrummikub.view;
+
+import jrummikub.util.IEvent;
+import jrummikub.util.MockEvent;
+
+public class MockPlayerPanel implements IPlayerPanel {
+ public MockEvent endTurnEvent = new MockEvent();
+ public MockHandPanel handPanel = new MockHandPanel();
+
+ @Override
+ public IHandPanel getHandPanel() {
+ // TODO Auto-generated method stub
+ return handPanel;
+ }
+
+ @Override
+ public void setTimeLeft(int time) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public IEvent getSortByGroupsEvent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IEvent getSortByRunsEvent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IEvent getEndTurnEvent() {
+ return endTurnEvent;
+ }
+
+}
diff --git a/mock/jrummikub/view/MockStoneCollectionPanel.java b/mock/jrummikub/view/MockStoneCollectionPanel.java
new file mode 100644
index 0000000..70016e5
--- /dev/null
+++ b/mock/jrummikub/view/MockStoneCollectionPanel.java
@@ -0,0 +1,28 @@
+package jrummikub.view;
+
+import jrummikub.model.Stone;
+import jrummikub.util.Event2;
+import jrummikub.util.IEvent2;
+
+public class MockStoneCollectionPanel implements IStoneCollectionPanel {
+
+ public Event2<Stone,Boolean> stoneClickEvent = new Event2<Stone, Boolean>();
+ public Event2<Stone,Boolean> setClickEvent = new Event2<Stone, Boolean>();
+
+ @Override
+ public IEvent2<Stone, Boolean> getStoneClickEvent() {
+ return stoneClickEvent;
+ }
+
+ @Override
+ public IEvent2<Stone, Boolean> getRangeClickEvent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IEvent2<Stone, Boolean> getSetClickEvent() {
+ return setClickEvent;
+ }
+
+}
diff --git a/mock/jrummikub/view/MockTablePanel.java b/mock/jrummikub/view/MockTablePanel.java
new file mode 100644
index 0000000..c32946f
--- /dev/null
+++ b/mock/jrummikub/view/MockTablePanel.java
@@ -0,0 +1,89 @@
+package jrummikub.view;
+
+import java.util.Map;
+
+import jrummikub.model.Position;
+import jrummikub.model.Stone;
+import jrummikub.model.StoneSet;
+import jrummikub.util.Event1;
+import jrummikub.util.Event2;
+import jrummikub.util.IEvent1;
+import jrummikub.util.IEvent2;
+import jrummikub.util.Pair;
+
+public class MockTablePanel implements ITablePanel {
+
+ public Event2<Stone, Boolean> stoneClickEvent = new Event2<Stone, Boolean>();
+ public Event2<Stone, Boolean> setClickEvent = new Event2<Stone, Boolean>();
+ public Event2<Stone, Boolean> rangeClickEvent = new Event2<Stone, Boolean>();
+
+ public MockStoneCollectionPanel stoneCollectionPanel = new MockStoneCollectionPanel();
+ public String leftPlayerName;
+ public String topPlayerName;
+ public String rightPlayerName;
+
+ public Iterable<Pair<StoneSet, Position>> stoneSets;
+
+ @Override
+ public IEvent2<Stone, Boolean> getStoneClickEvent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IEvent2<Stone, Boolean> getRangeClickEvent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IEvent2<Stone, Boolean> getSetClickEvent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IEvent1<Position> getClickEvent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void setLeftPlayerName(String playerName) {
+ leftPlayerName = playerName;
+ }
+
+ @Override
+ public void setTopPlayerName(String playerName) {
+ topPlayerName = playerName;
+ }
+
+ @Override
+ public void setRightPlayerName(String playerName) {
+ rightPlayerName = playerName;
+ }
+
+ @Override
+ public void setStoneSets(Iterable<Pair<StoneSet, Position>> stoneSets) {
+ this.stoneSets = stoneSets;
+ }
+
+ @Override
+ public IStoneCollectionPanel getStoneCollectionPanel() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Event1<StoneSet> getLeftConnectorClickEvent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Event1<StoneSet> getRightConnectorClickEvent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/mock/jrummikub/view/MockView.java b/mock/jrummikub/view/MockView.java
new file mode 100644
index 0000000..44b6a78
--- /dev/null
+++ b/mock/jrummikub/view/MockView.java
@@ -0,0 +1,68 @@
+package jrummikub.view;
+
+import java.util.Collection;
+
+import jrummikub.model.Stone;
+import jrummikub.util.IEvent;
+import jrummikub.util.MockEvent;
+
+public class MockView implements IView {
+ public MockPlayerPanel playerPanel = new MockPlayerPanel();
+ public MockTablePanel tablePanel = new MockTablePanel();
+
+ public Collection<Stone> selectedStones;
+
+ public String currentPlayerName;
+ public boolean displayStartTurnPanel = false;
+ public boolean displayWinPanel = false;
+
+ public MockEvent startTurnEvent = new MockEvent();
+ public MockEvent quitEvent = new MockEvent();
+ public MockEvent newGameEvent = new MockEvent();
+
+ @Override
+ public MockTablePanel getTablePanel() {
+ return tablePanel;
+ }
+
+ @Override
+ public MockPlayerPanel getPlayerPanel() {
+ return playerPanel;
+ }
+
+ @Override
+ public void setCurrentPlayerName(String playerName) {
+ currentPlayerName = playerName;
+ }
+
+ @Override
+ public void setSelectedStones(Collection<Stone> stones) {
+ selectedStones = stones;
+ }
+
+ @Override
+ public void enableStartTurnPanel(boolean enable) {
+ displayStartTurnPanel = enable;
+ }
+
+ @Override
+ public IEvent getStartTurnEvent() {
+ return startTurnEvent;
+ }
+
+ @Override
+ public void enableWinPanel(boolean enable) {
+ displayWinPanel = enable;
+ }
+
+ @Override
+ public IEvent getQuitEvent() {
+ return quitEvent;
+ }
+
+ @Override
+ public IEvent getNewGameEvent() {
+ return newGameEvent;
+ }
+
+} \ No newline at end of file