Kommentare und kleinere Umbauten
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@426 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
570187c950
commit
f5a05f2c8d
12 changed files with 231 additions and 70 deletions
|
@ -1,54 +1,55 @@
|
|||
package jrummikub.view;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import jrummikub.model.GameSettings;
|
||||
import jrummikub.util.GameData;
|
||||
import jrummikub.util.IEvent;
|
||||
import jrummikub.util.IEvent1;
|
||||
|
||||
/**
|
||||
* Panel showing all offered games in the chosen channel
|
||||
*/
|
||||
public interface IGameListPanel {
|
||||
public static class GameData {
|
||||
private UUID gameID;
|
||||
private String host;
|
||||
private GameSettings gameSettings;
|
||||
|
||||
public GameData(UUID gameID, GameSettings settings) {
|
||||
this(gameID, settings, null);
|
||||
}
|
||||
|
||||
public GameData(UUID gameID, GameSettings settings, String host) {
|
||||
this.gameID = gameID;
|
||||
this.gameSettings = settings;
|
||||
this.host = host;
|
||||
|
||||
}
|
||||
|
||||
public void setGameSettings(GameSettings settings) {
|
||||
gameSettings = settings;
|
||||
}
|
||||
|
||||
public GameSettings getGameSettings() {
|
||||
return gameSettings;
|
||||
}
|
||||
|
||||
public String getHost() {
|
||||
return host;
|
||||
}
|
||||
|
||||
public UUID getGameID() {
|
||||
return gameID;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Emitted when a new game is offered
|
||||
*
|
||||
* @return the event
|
||||
*/
|
||||
public IEvent getOpenNewGameEvent();
|
||||
|
||||
/**
|
||||
* Emitted when the network game is canceled
|
||||
*
|
||||
* @return the event
|
||||
*/
|
||||
public IEvent getCancelEvent();
|
||||
|
||||
/**
|
||||
* Emitted when the user chose to join an existing, open game
|
||||
*
|
||||
* @return the event
|
||||
*/
|
||||
public IEvent1<GameData> getJoinEvent();
|
||||
|
||||
/**
|
||||
* Emitted when an open game is removed by the host
|
||||
*
|
||||
* @param game
|
||||
* game data of the open game
|
||||
*/
|
||||
public void removeGame(GameData game);
|
||||
|
||||
/**
|
||||
* Adds a game to the list of open games
|
||||
*
|
||||
* @param game
|
||||
* game data of the new game
|
||||
*/
|
||||
public void addGame(GameData game);
|
||||
|
||||
/**
|
||||
* Sets the channel name
|
||||
*
|
||||
* @param name
|
||||
* channel name
|
||||
*/
|
||||
public void setChannelName(String name);
|
||||
}
|
||||
|
|
|
@ -17,6 +17,11 @@ public interface ILoginPanel {
|
|||
*/
|
||||
public IEvent1<LoginData> getLoginEvent();
|
||||
|
||||
/**
|
||||
* Emitted when the user cancels the login process
|
||||
*
|
||||
* @return the event
|
||||
*/
|
||||
public IEvent getCancelEvent();
|
||||
|
||||
}
|
|
@ -36,11 +36,17 @@ public interface ISettingsPanel {
|
|||
new Color(1.0f, 1.0f, 1.0f), // white
|
||||
};
|
||||
|
||||
/**
|
||||
* enables the start of a network game at a given point in game
|
||||
*
|
||||
* @param enable
|
||||
* starting a network game
|
||||
*/
|
||||
public void enableNetworkMode(boolean enable);
|
||||
|
||||
/**
|
||||
* The add player event is emitted when the user wants to add a player to the
|
||||
* player list
|
||||
* The add player event is emitted when the user wants to add a player to
|
||||
* the player list
|
||||
*
|
||||
* @return the event
|
||||
*/
|
||||
|
@ -87,8 +93,8 @@ public interface ISettingsPanel {
|
|||
public IEvent1<Integer> getChangeInitialMeldThresholdEvent();
|
||||
|
||||
/**
|
||||
* The change StoneSet number event is emitted when the user wants to use more
|
||||
* or less than 2 StoneSets per color
|
||||
* The change StoneSet number event is emitted when the user wants to use
|
||||
* more or less than 2 StoneSets per color
|
||||
*
|
||||
* @return number of SoneSets
|
||||
*/
|
||||
|
@ -129,7 +135,7 @@ public interface ISettingsPanel {
|
|||
* Sets an error to display
|
||||
*
|
||||
* @param error
|
||||
* the kind of error
|
||||
* the kind of error
|
||||
*/
|
||||
public void setError(SettingsError error);
|
||||
|
||||
|
@ -137,7 +143,7 @@ public interface ISettingsPanel {
|
|||
* Enables or disables the start game button
|
||||
*
|
||||
* @param enable
|
||||
* specifies if the button is to be enabled or disabled
|
||||
* specifies if the button is to be enabled or disabled
|
||||
*/
|
||||
public void enableStartGameButton(boolean enable);
|
||||
|
||||
|
@ -145,7 +151,7 @@ public interface ISettingsPanel {
|
|||
* Enables or disables the add player button
|
||||
*
|
||||
* @param enable
|
||||
* specifies if the button is to be enabled or disabled
|
||||
* specifies if the button is to be enabled or disabled
|
||||
*/
|
||||
public void enableAddPlayerButton(boolean enable);
|
||||
|
||||
|
@ -153,7 +159,7 @@ public interface ISettingsPanel {
|
|||
* Enables or disables the remove player buttons
|
||||
*
|
||||
* @param enable
|
||||
* specifies if the buttons are to be enabled or disabled
|
||||
* specifies if the buttons are to be enabled or disabled
|
||||
*/
|
||||
|
||||
public void enableRemovePlayerButtons(List<Boolean> enable);
|
||||
|
@ -162,7 +168,7 @@ public interface ISettingsPanel {
|
|||
* Sets the game settings to display
|
||||
*
|
||||
* @param gameSettings
|
||||
* the settings
|
||||
* the settings
|
||||
*/
|
||||
public void setGameSettings(GameSettings gameSettings);
|
||||
|
||||
|
@ -201,12 +207,34 @@ public interface ISettingsPanel {
|
|||
*/
|
||||
public IEvent getSetVariantChildrenEvent();
|
||||
|
||||
/**
|
||||
* Emitted when the user wants to go back to the panel before
|
||||
*
|
||||
* @return the event
|
||||
*/
|
||||
public IEvent getBackEvent();
|
||||
|
||||
/**
|
||||
* Sets the types of players allowed at the given point in game
|
||||
*
|
||||
* @param choices
|
||||
* list of types for each player
|
||||
*/
|
||||
public void setPlayerTypeChoices(List<List<Type>> choices);
|
||||
|
||||
/**
|
||||
* Sets the names of players editable if allowed at the given point in game
|
||||
*
|
||||
* @param editable
|
||||
* states if the players name is editable for each player
|
||||
*/
|
||||
public void setPlayerNamesEditable(List<Boolean> editable);
|
||||
|
||||
/**
|
||||
* Emitted when a new game is started and looking for players
|
||||
*
|
||||
* @return the event
|
||||
*/
|
||||
public IEvent getOfferGameEvent();
|
||||
|
||||
/**
|
||||
|
|
|
@ -23,6 +23,7 @@ import javax.swing.border.LineBorder;
|
|||
|
||||
import jrummikub.util.Event;
|
||||
import jrummikub.util.Event1;
|
||||
import jrummikub.util.GameData;
|
||||
import jrummikub.util.IEvent;
|
||||
import jrummikub.util.IEvent1;
|
||||
import jrummikub.view.IGameListPanel;
|
||||
|
|
Reference in a new issue