package jrummikub.control.network; import java.awt.Color; import java.util.UUID; import jrummikub.util.GameData; 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 MockConnectionControl implements IConnectionControl { /** */ public String nickname; /** */ public MockEvent connectedEvent = new MockEvent(); /** */ public MockEvent connectionFailedEvent = new MockEvent(); /** */ public MockEvent1 gameOfferEvent = new MockEvent1(); /** */ public MockEvent1 gameWithdrawalEvent = new MockEvent1(); /** */ public MockEvent1 gameJoinEvent = new MockEvent1(); /** */ public MockEvent1 gameLeaveEvent = new MockEvent1(); /** */ public MockEvent1 gameJoinAckEvent = new MockEvent1(); /** */ public MockEvent2 changeColorEvent = new MockEvent2(); /** */ public GameData currentGame; /** */ public GameData offeredGame; /** */ public boolean connected; /** */ public boolean failOnConnect; /** */ public GameData joinedGame; @Override public String getNickname() { return nickname; } @Override public void connect() { if (failOnConnect) { connectionFailedEvent.emit(); } else { connected = true; connectedEvent.emit(); } } @Override public void disconnect() { connected = false; } @Override public IEvent getConnectedEvent() { return connectedEvent; } @Override public IEvent getConnectionFailedEvent() { return connectionFailedEvent; } @Override public IEvent1 getGameOfferEvent() { return gameOfferEvent; } @Override public IEvent1 getGameWithdrawalEvent() { return gameWithdrawalEvent; } @Override public IEvent1 getGameJoinEvent() { return gameJoinEvent; } @Override public IEvent1 getGameLeaveEvent() { return gameLeaveEvent; } @Override public IEvent1 getGameJoinAckEvent() { return gameJoinAckEvent; } @Override public IEvent2 getChangeColorEvent() { return changeColorEvent; } @Override public void offerGame(GameData data) { // TODO Auto-generated method stub } @Override public void withdrawGame() { // TODO Auto-generated method stub } @Override public GameData getCurrentGame() { return currentGame; } @Override public void setCurrentGame(GameData game) { currentGame = game; } @Override public void joinGame(GameData game) { currentGame = game; joinedGame = game; } @Override public void leaveGame() { // TODO Auto-generated method stub } @Override public void ackJoinGame(String recipient, boolean ack) { // TODO Auto-generated method stub } @Override public void changeColor(Color color) { // TODO Auto-generated method stub } }