Skip to content
Snippets Groups Projects
Commit 35ba3831 authored by Corentin-Boulanger's avatar Corentin-Boulanger
Browse files

added javadoc for server.IComToData and server.IDataToCom

parent 03277ef4
Branches main
No related tags found
No related merge requests found
This commit is part of merge request !8. Comments created here will be created in the context of that merge request.
......@@ -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
......@@ -6,11 +6,34 @@ import baleine.common.dataModel.Board;
import baleine.common.dataModel.GameLight;
import baleine.common.dataModel.UserLight;
/**
* IDataToCom This class is an interface which provides server methods to
* communicate from Data to Com modules.
*/
public interface IDataToCom {
/**
* Notifies that a new game has been created.
*
* @param newGameCreated : the new game created
*/
public void notifyNewGame(GameLight newGameCreated);
/**
* Sends a move update message to the different users of a game.
*
* @param players : the players of the game
* @param spectators : the spectators of the game
* @param updateBoard : the board to update
*/
public void sendUpdateMoveMessage(ArrayList<UserLight> players, ArrayList<UserLight> spectators, Board updateBoard);
/**
* Sends an end message to the different users of a game.
*
* @param players : the players of the game
* @param spectators : the spectators of the game
* @param updateBoard : the board to update
*/
public void sendEndMoveMessage(ArrayList<UserLight> players, ArrayList<UserLight> spectators, Board updateBoard);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment