diff options
author | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-05-04 17:33:44 +0200 |
---|---|---|
committer | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-05-04 17:33:44 +0200 |
commit | d837354c56671472d62d5a258fd3554ba0307a2f (patch) | |
tree | 9eb3cd278283afda51f7d25f0fa411f0e25564f6 | |
parent | 8199274c9d4158a4bbf5361f3506f144e75344c1 (diff) | |
download | JRummikub-d837354c56671472d62d5a258fd3554ba0307a2f.tar JRummikub-d837354c56671472d62d5a258fd3554ba0307a2f.zip |
Started implementing mock views
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@110 72836036-5685-4462-b002-a69064685172
-rw-r--r-- | src/jrummikub/control/TurnControl.java | 16 | ||||
-rw-r--r-- | test/jrummikub/view/MockPlayerPanel.java | 37 | ||||
-rw-r--r-- | test/jrummikub/view/MockView.java | 65 |
3 files changed, 115 insertions, 3 deletions
diff --git a/src/jrummikub/control/TurnControl.java b/src/jrummikub/control/TurnControl.java index c994ca1..612597a 100644 --- a/src/jrummikub/control/TurnControl.java +++ b/src/jrummikub/control/TurnControl.java @@ -1,23 +1,33 @@ package jrummikub.control; -import jrummikub.model.Hand; +import jrummikub.model.IHand; import jrummikub.model.ITable; import jrummikub.util.Event; import jrummikub.util.IEvent; import jrummikub.view.IView; public class TurnControl { - private Hand hand; + private IHand hand; private ITable table; private ITurnTimer timer; private IView view; private Event endOfTurnEvent = new Event(); - public TurnControl(Hand hand, ITable table, IView view) { + + public TurnControl(IHand hand, ITable table, IView view) { + this.hand = hand; + this.table = table; + this.view = view; + } + + /** Test only constructor **/ + TurnControl(IHand hand, ITable table, IView view, ITurnTimer testTimer) { + // TODO: change timer to interface this.hand = hand; this.table = table; this.view = view; + this.timer = testTimer; } private void sortByValue() { diff --git a/test/jrummikub/view/MockPlayerPanel.java b/test/jrummikub/view/MockPlayerPanel.java new file mode 100644 index 0000000..b144bbb --- /dev/null +++ b/test/jrummikub/view/MockPlayerPanel.java @@ -0,0 +1,37 @@ +package jrummikub.view; + +import jrummikub.util.Event; +import jrummikub.util.IEvent; + +public class MockPlayerPanel implements IPlayerPanel { + public Event endTurnEvent = new Event(); + @Override + public IHandPanel getHandPanel() { + // TODO Auto-generated method stub + return null; + } + + @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/test/jrummikub/view/MockView.java b/test/jrummikub/view/MockView.java new file mode 100644 index 0000000..9b526a6 --- /dev/null +++ b/test/jrummikub/view/MockView.java @@ -0,0 +1,65 @@ +package jrummikub.view; +import java.util.Collection; + +import jrummikub.model.Stone; +import jrummikub.util.IEvent; + +public class MockView implements IView { + public MockPlayerPanel playerPanel = new MockPlayerPanel(); + + @Override + public ITablePanel getTablePanel() { + // TODO Auto-generated method stub + return null; + } + + @Override + public IPlayerPanel getPlayerPanel() { + return playerPanel; + } + + @Override + public void setCurrentPlayerName(String playerName) { + // TODO Auto-generated method stub + + } + + @Override + public void setSelectedStones(Collection<Stone> stones) { + // TODO Auto-generated method stub + + } + + @Override + public void enableStartTurnPanel(boolean enable) { + // TODO Auto-generated method stub + + } + + @Override + public IEvent getStartTurnEvent() { + // TODO Auto-generated method stub + return null; + } + + @Override + public void enableWinPanel(boolean enable) { + // TODO Auto-generated method stub + + } + + @Override + public IEvent getQuitEvent() { + // TODO Auto-generated method stub + return null; + } + + @Override + public IEvent getNewGameEvent() { + // TODO Auto-generated method stub + return null; + } + + + +}
\ No newline at end of file |