Refactoring

This commit is contained in:
magenoxx 2012-05-26 21:00:47 +04:00
parent aa8fbd6fab
commit af2cfd8095
11 changed files with 508 additions and 137 deletions

View file

@ -28,150 +28,15 @@
package mage.remote;
import mage.cards.decks.DeckCardLists;
import mage.game.match.MatchOptions;
import mage.game.tournament.TournamentOptions;
import mage.interfaces.Action;
import mage.view.*;
import java.util.Collection;
import java.util.List;
import java.util.UUID;
import mage.remote.interfaces.*;
/**
* Extracted interface for SessionImpl class.
*
* @author noxx
*/
public interface Session {
boolean connect(Connection connection);
boolean stopConnecting();
boolean connect();
void disconnect(boolean showMessage);
boolean sendFeedback(String title, String type, String message, String email);
boolean isConnected();
boolean ping();
String[] getPlayerTypes();
List<GameTypeView> getGameTypes();
String[] getDeckTypes();
List<TournamentTypeView> getTournamentTypes();
boolean isTestMode();
UUID getMainRoomId();
UUID getRoomChatId(UUID roomId);
UUID getTableChatId(UUID tableId);
UUID getGameChatId(UUID gameId);
TableView getTable(UUID roomId, UUID tableId);
boolean watchTable(UUID roomId, UUID tableId);
boolean joinTable(UUID roomId, UUID tableId, String playerName, String playerType, int skill, DeckCardLists deckList);
boolean joinTournamentTable(UUID roomId, UUID tableId, String playerName, String playerType, int skill);
Collection<TableView> getTables(UUID roomId) throws MageRemoteException;
Collection<MatchView> getFinishedMatches(UUID roomId) throws MageRemoteException;
Collection<String> getConnectedPlayers(UUID roomId) throws MageRemoteException;
TournamentView getTournament(UUID tournamentId) throws MageRemoteException;
UUID getTournamentChatId(UUID tournamentId);
boolean sendPlayerUUID(UUID gameId, UUID data);
boolean sendPlayerBoolean(UUID gameId, boolean data);
boolean sendPlayerInteger(UUID gameId, int data);
boolean sendPlayerString(UUID gameId, String data);
DraftPickView sendCardPick(UUID draftId, UUID cardId);
boolean joinChat(UUID chatId);
boolean leaveChat(UUID chatId);
boolean sendChatMessage(UUID chatId, String message);
boolean sendBroadcastMessage(String message);
boolean joinGame(UUID gameId);
boolean joinDraft(UUID draftId);
boolean joinTournament(UUID tournamentId);
boolean watchGame(UUID gameId);
boolean replayGame(UUID gameId);
TableView createTable(UUID roomId, MatchOptions matchOptions);
TableView createTournamentTable(UUID roomId, TournamentOptions tournamentOptions);
boolean isTableOwner(UUID roomId, UUID tableId);
boolean removeTable(UUID roomId, UUID tableId);
boolean removeTable(UUID tableId);
boolean swapSeats(UUID roomId, UUID tableId, int seatNum1, int seatNum2);
boolean leaveTable(UUID roomId, UUID tableId);
boolean startGame(UUID roomId, UUID tableId);
boolean startTournament(UUID roomId, UUID tableId);
boolean startChallenge(UUID roomId, UUID tableId, UUID challengeId);
boolean submitDeck(UUID tableId, DeckCardLists deck);
boolean updateDeck(UUID tableId, DeckCardLists deck);
boolean concedeGame(UUID gameId);
boolean stopWatching(UUID gameId);
boolean startReplay(UUID gameId);
boolean stopReplay(UUID gameId);
boolean nextPlay(UUID gameId);
boolean previousPlay(UUID gameId);
boolean skipForward(UUID gameId, int moves);
boolean cheat(UUID gameId, UUID playerId, DeckCardLists deckList);
List<UserView> getUsers();
List<String> getServerMessages();
boolean disconnectUser(String userSessionId);
String getUserName();
boolean updateAvatar(int avatarId);
public interface Session extends ClientData, Connect, GamePlay, GameTypes, ServerState, ChatSession, Feedback, PlayerActions, Replays, Testable {
void setEmbeddedMageServerAction(Action embeddedMageServerAction);
}