Skip to content
Snippets Groups Projects

Feature/com/server classes

Merged Alexandre Ducarne requested to merge feature/com/serverClasses into int/v1
All threads resolved!
24 files
+ 507
0
Compare changes
  • Side-by-side
  • Inline
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;
/**
* IComToData This class is an interface which provides client methods to
* communicate from Com to Data modules.
*/
public interface IComToData {
/**
* Sends a user profile to the data module.
*
* @param user : the user to forward
*/
public void forwardPlayerProfile(UserLight user);
/**
* Adds an authenticated player to local data.
*
* @param user : the user to add
*/
public void addAuthenticatedPlayer(UserLight user);
/**
* Receives the data from a game.
*
* @param user : the list of users of the game
*/
public void receiveGameData(ArrayList<UserLight> user);
/**
* Adds a new user to the list.
*
* @param user : the user to add to the list
*/
public void addNewUser(UserLight user);
/**
* Notifies the data module that a new game has been created.
*
* @param newGameCreated : the game created
*/
public void notifyNewGame(GameLight newGameCreated);
/**
* Sends 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);
/**
* Receives a chat message.
*
* @param message : the message to receive
*/
public void receiveChatMessage(Message message);
/**
* Notifies the data module that a user has been disconnected.
*
* @param user : the UUID of the disconnected user
*/
public void removeDisconnectedUser(UUID user);
/**
* Notifies the data module that a new spectator has been added.
*
* @param spectator : the new spectator
*/
public void addSpectatorToGame(UserLight spectator);
/**
* Receives 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);
/**
* Receives 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);
/**
* Notifies that the game is ended.
*
* @param game : the game ended
*/
public void notifyEndGame(GameLight game);
/**
* Notifies the data module that the board has been updated.
*
* @param board : the board updated
*/
public void updateBoard(Board board);
/**
* Ends a game in the data modue.
*
* @param endGameInfo : the game ended
*/
public void endGame(GameLight endGameInfo);
}
Loading