Skip to content
Snippets Groups Projects

Feature/com/server classes

Merged Alexandre Ducarne requested to merge feature/com/serverClasses into int/v1
Files
24
package baleine.common.interfaces.client;
import java.util.ArrayList;
import java.util.UUID;
import baleine.common.dataModel.Board;
import baleine.common.dataModel.GameHeavy;
import baleine.common.dataModel.GameLight;
import baleine.common.dataModel.Message;
import baleine.common.dataModel.UserLight;
/**
* This class is an interface which provides client methods to communicate from
* Com to Data modules.
*/
public interface IComToData {
/**
* Send a user profile to the data module.
*
* @param user : the user to forward
*/
public void forwardPlayerProfile(UserLight user);
/**
* Add an authenticated player to local data.
*
* @param user : the user to add
*/
public void addAuthenticatedPlayer(UserLight user);
/**
* Receive the data from a game.
*
* @param user : the list of users of the game
*/
public void receiveGameData(ArrayList<UserLight> user);
/**
* Add a new user to the list.
*
* @param user : the user to add to the list
*/
public void addNewUser(UserLight user);
/**
* Notify the data module that a new game has been created.
*
* @param newGameCreated : the game created
*/
public void notifyNewGame(GameLight newGameCreated);
/**
* Send a saved game to the data module.
*
* @param game : the game saved
* @param userId : the UUID of the user who saves the game
*/
public void sendGameSave(GameHeavy game, UUID userId);
/**
* Receive a chat message.
*
* @param message : the message to receive
*/
public void receiveChatMessage(Message message);
/**
* Notify the data module that a user has been disconnected.
*
* @param user : the UUID of the disconnected user
*/
public void removeDisconnectedUser(UUID user);
/**
* Notify the data module that a new spectator has been added.
*
* @param spectator : the new spectator
*/
public void addSpectatorToGame(UserLight spectator);
/**
* Receive the answer to a game join request.
*
* @param isAccepted : the answer to the join request
* @param gameUUID : the UUID of the game to join
*/
public void receiveJoinRequestAnswer(boolean isAccepted, UUID gameUUID);
/**
* Receive a join request.
*
* @param userProposingUUID : the UUID of the user wanting to join the game
* @param gameUUID : the UUID of the game to join
*/
public void receiveJoinRequest(UUID userProposingUUID, UUID gameUUID);
/**
* Notify that the game is ended.
*
* @param game : the game ended
*/
public void notifyEndGame(GameLight game);
/**
* Notify the data module that the board has been updated.
*
* @param board : the board updated
*/
public void updateBoard(Board board);
/**
* End a game in the data modue.
*
* @param endGameInfo : the game ended
*/
public void endGame(GameLight endGameInfo);
}
Loading