Skip to content
Snippets Groups Projects

Feature/com/server classes

Merged Alexandre Ducarne requested to merge feature/com/serverClasses into int/v1
2 files
+ 91
13
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -10,23 +10,78 @@ import baleine.common.dataModel.Message;
import baleine.common.dataModel.Move;
import baleine.common.dataModel.UserLight;
/**
* IComToData This class is an interface which provides server methods to
* communicate from Com to Data modules.
*/
public interface IComToData {
public void requestPlayerByUUID(UUID playerID);
public void addNewUser(UserLight userLight);
/**
* Requests a player by its UUID.
*
* @param playerID : the UUID of the player to retrieve
*/
public void requestPlayerByUUID(UUID playerID);
public void createGame(GameLight gameLight);
/**
* Adds a new user to the list.
*
* @param userLight : the user to add
*/
public void addNewUser(UserLight userLight);
public void requestGameSave(UUID gameID);
/**
* Create a new game.
*
* @param gameLight : the game to create
*/
public void createGame(GameLight gameLight);
public Message receiveNewChatMessage(String message, Timestamp timestamp, UUID userID, UUID gameID);
/**
* Request saving a game by UUID.
*
* @param gameID : the UUID of the game to save
*/
public void requestGameSave(UUID gameID);
public ArrayList<UUID> getAllGameParticipants (UUID gameID);
/**
* Receive a new chat message to transfer it.
*
* @param message : the message to transfer
* @param timestamp : the timestamp of the message
* @param userID : the UUID of the user sending the message
* @param gameID : the UUID of the game in which the message was sent
* @return the message to transfer
*/
public Message receiveNewChatMessage(String message, Timestamp timestamp, UUID userID, UUID gameID);
public void disconnectUser(UUID userID);
/**
* Get all the participants (players & spectators) of a game.
*
* @param gameID : the UUID of the game
* @return the list of users
*/
public ArrayList<UUID> getAllGameParticipants(UUID gameID);
public void addSpectator(GameLight gameLight, UserLight userLight);
/**
* Notifies that a user has been disconnected.
*
* @param userID : the UUID of the disconnected user
*/
public void disconnectUser(UUID userID);
public void sendMove(Move move);
/**
* Adds a spectator to a game.
*
* @param gameLight : the game concerned
* @param userLight : the user to add as spectator
*/
public void addSpectator(GameLight gameLight, UserLight userLight);
/**
* Send a move to the data module.
*
* @param move : the move to send
*/
public void sendMove(Move move);
}
\ No newline at end of file
Loading