Coverage Summary for Class: ErrorType (it.polimi.ingsw.gc14)
| Class |
Class, %
|
Method, %
|
Line, %
|
| ErrorType |
0%
(0/1)
|
0%
(0/4)
|
0%
(0/12)
|
package it.polimi.ingsw.gc14;
/** Enumeration of error types that can be returned by server-side operations. */
public enum ErrorType {
/** The chosen username is already taken by another connected player. */
INVALID_USERNAME("Username is already in use or too long"),
/** The user is already connected to the server. */
USER_ALREADY_CONNECTED("User is already connected"),
/** The requested number of players is outside the allowed range. */
WRONG_PLAYER_NUMBER("Wrong player number"),
/** The server has crashed or become unreachable. */
SERVER_CRASHED("Server crashed"),
/** The server is unreachable. */
SERVER_UNREACHABLE("Server unreachable"),
/** A generic, unclassified error occurred. */
GENERIC_ERROR("Generic error"),
/** The game has already started and cannot accept new players. */
GAME_ALREADY_STARTED("Game already started"),
/** The action attempted is not valid in the current game state. */
WRONG_ACTION("Wrong action");
/** Human-readable description of this error, returned by {@link #toString()}. */
private final String description;
/**
* Creates an error type constant with the given human-readable description.
*
* @param description the message returned by {@link #toString()}.
*/
ErrorType(String description) {
this.description = description;
}
/**
* Returns the human-readable description of this error.
*
* @return the error description string.
*/
@Override
public String toString() {
return description;
}
}