diff options
Diffstat (limited to 'mock')
-rw-r--r-- | mock/jrummikub/view/MockSettingsPanel.java | 87 | ||||
-rw-r--r-- | mock/jrummikub/view/MockView.java | 5 |
2 files changed, 90 insertions, 2 deletions
diff --git a/mock/jrummikub/view/MockSettingsPanel.java b/mock/jrummikub/view/MockSettingsPanel.java new file mode 100644 index 0000000..55090b5 --- /dev/null +++ b/mock/jrummikub/view/MockSettingsPanel.java @@ -0,0 +1,87 @@ +package jrummikub.view; + +import java.awt.Color; + +import jrummikub.model.GameSettings; +import jrummikub.util.IEvent; +import jrummikub.util.IEvent1; +import jrummikub.util.IEvent2; +import jrummikub.util.MockEvent; +import jrummikub.util.MockEvent1; +import jrummikub.util.MockEvent2; + +public class MockSettingsPanel implements ISettingsPanel { + + public MockEvent addPlayerEvent = new MockEvent(); + public MockEvent1<Integer> removePlayerEvent = new MockEvent1<Integer>(); + public MockEvent2<Integer, Color> changePlayerColorEvent = new MockEvent2<Integer, Color>(); + public MockEvent2<Integer, String> changePlayerNameEvent = new MockEvent2<Integer, String>(); + public MockEvent1<Integer> changeInitialMeldThresholdEvent = new MockEvent1<Integer>(); + public MockEvent startGameEvent = new MockEvent(); + public SettingsError error = SettingsError.NO_ERROR; + public boolean startButtonEnabled = true; + public boolean addPlayerButtonEnabled = true; + public boolean removePlayerButtonsEnabled = false; + public GameSettings gameSettings = new GameSettings(); + + @Override + public IEvent getAddPlayerEvent() { + return addPlayerEvent; + } + + @Override + public IEvent1<Integer> getRemovePlayerEvent() { + return removePlayerEvent; + } + + @Override + public IEvent2<Integer, Color> getChangePlayerColorEvent() { + return changePlayerColorEvent; + } + + @Override + public IEvent2<Integer, String> getChangePlayerNameEvent() { + return changePlayerNameEvent; + } + + @Override + public IEvent1<Integer> getChangeInitialMeldThresholdEvent() { + return changeInitialMeldThresholdEvent; + } + + @Override + public IEvent getStartGameEvent() { + return startGameEvent; + } + + @Override + public void setError(SettingsError error) { + this.error = error; + + } + + @Override + public void enableStartGameButton(boolean enable) { + startButtonEnabled = enable; + + } + + @Override + public void enableAddPlayerButton(boolean enable) { + addPlayerButtonEnabled = enable; + + } + + @Override + public void enableRemovePlayerButtons(boolean enable) { + removePlayerButtonsEnabled = enable; + + } + + @Override + public void setGameSettings(GameSettings gameSettings) { + this.gameSettings = gameSettings; + + } + +} diff --git a/mock/jrummikub/view/MockView.java b/mock/jrummikub/view/MockView.java index 5e145da..431641a 100644 --- a/mock/jrummikub/view/MockView.java +++ b/mock/jrummikub/view/MockView.java @@ -11,6 +11,8 @@ import jrummikub.util.MockEvent; */ public class MockView implements IView { /** */ + public MockSettingsPanel settingsPanel = new MockSettingsPanel(); + public MockPlayerPanel playerPanel = new MockPlayerPanel(); /** */ public MockTablePanel tablePanel = new MockTablePanel(); @@ -86,8 +88,7 @@ public class MockView implements IView { @Override public ISettingsPanel getSettingsPanel() { - // TODO Auto-generated method stub - return null; + return settingsPanel; } @Override |