merge the new developmentbranch into the test branch #39

Closed
j23f0712 wants to merge 431 commits from development2 into dev/test
47 changed files with 61 additions and 533 deletions
Showing only changes of commit de899cef35 - Show all commits

View File

@@ -66,4 +66,9 @@ public Node[] getInfield() {
public void setPieceOnBoard(int index, Piece piece) { public void setPieceOnBoard(int index, Piece piece) {
infield[index].setOccupant(piece); infield[index].setOccupant(piece);
} }
@Override
public String toString(){
return "Default Board";
}
} }

View File

@@ -254,4 +254,9 @@ public void setActive(boolean active) {
public void setPieceInHome(int index, Piece piece) { public void setPieceInHome(int index, Piece piece) {
this.homeNodes[index].setOccupant(piece); this.homeNodes[index].setOccupant(piece);
} }
@Override
public String toString(){
return "Player: " + name + " Color: " + color;
}
} }

View File

@@ -14,16 +14,6 @@ public AnimationEndMessage() {
super(); super();
} }
/**
* Returns a string representation of this message.
*
* @return a string representation of this message
*/
@Override
public String toString() {
return "AnimationEnd{}";
}
/** /**
* Accepts a visitor for processing this message. * Accepts a visitor for processing this message.
* *

View File

@@ -21,4 +21,8 @@ protected ClientMessage() {
* @param from the connection ID of the sender * @param from the connection ID of the sender
*/ */
public abstract void accept(ClientInterpreter interpreter, int from); public abstract void accept(ClientInterpreter interpreter, int from);
public String toString() {
return getClass().getSimpleName() + "{}";
}
} }

View File

@@ -24,14 +24,4 @@ public ClientStartGameMessage() {
public void accept(ClientInterpreter interpreter, int from) { public void accept(ClientInterpreter interpreter, int from) {
interpreter.received(this, from); interpreter.received(this, from);
} }
/**
* This method will be used to return all necessary information of StartGameMessage in a more readable way.
*
* @return information as a String.
*/
@Override
public String toString() {
return "ClientStartGameMessage{}";
}
} }

View File

@@ -11,16 +11,6 @@ public DisconnectedMessage() {
super(); super();
} }
/**
* Returns a string representation of this message.
*
* @return a string representation of this message
*/
@Override
public String toString() {
return "ClientStartGame{}";
}
/** /**
* Accepts a visitor to process this message. * Accepts a visitor to process this message.
* *

View File

@@ -14,16 +14,6 @@ public ForceContinueGameMessage() {
super(); super();
} }
/**
* Returns a string representation of this message.
*
* @return a string representation of this message
*/
@Override
public String toString() {
return "ForceContinueGame{}";
}
/** /**
* Accepts a visitor to process this message. * Accepts a visitor to process this message.
* *

View File

@@ -42,7 +42,7 @@ public String getName(){
*/ */
@Override @Override
public String toString() { public String toString() {
return "JoinServer{}"; return "JoinServer {" + "name=" + name + '}';
} }
/** /**

View File

@@ -14,16 +14,6 @@ public LeaveGameMessage() {
super(); super();
} }
/**
* Returns a string representation of this message.
*
* @return a string representation of this message
*/
@Override
public String toString() {
return "LeaveGame{}";
}
/** /**
* Accepts a visitor to process this message. * Accepts a visitor to process this message.
* *

View File

@@ -14,16 +14,6 @@ public LobbyNotReadyMessage() {
super(); super();
} }
/**
* Returns a string representation of this message.
*
* @return a string representation of this message
*/
@Override
public String toString() {
return "LobbyNotReady{}";
}
/** /**
* Accepts a visitor to process this message. * Accepts a visitor to process this message.
* *

View File

@@ -14,16 +14,6 @@ public LobbyReadyMessage() {
super(); super();
} }
/**
* Returns a string representation of this message.
*
* @return a string representation of this message
*/
@Override
public String toString() {
return "LobbyReady{}";
}
/** /**
* Accepts a visitor to process this message. * Accepts a visitor to process this message.
* *

View File

@@ -14,16 +14,6 @@ public NoPowerCardMessage() {
super(); super();
} }
/**
* Returns a string representation of this message.
*
* @return a string representation of this message
*/
@Override
public String toString() {
return "NoPowerCard{}";
}
/** /**
* Accepts a visitor to process this message. * Accepts a visitor to process this message.
* *

View File

@@ -14,16 +14,6 @@ public RequestBriefingMessage() {
super(); super();
} }
/**
* Returns a string representation of this message.
*
* @return a string representation of this message
*/
@Override
public String toString() {
return "RequestBriefing{}";
}
/** /**
* Accepts a visitor to process this message. * Accepts a visitor to process this message.
* *

View File

@@ -14,16 +14,6 @@ public RequestDieMessage() {
super(); super();
} }
/**
* Returns a string representation of this message.
*
* @return a string representation of this message
*/
@Override
public String toString() {
return "RequestDie{}";
}
/** /**
* Accepts a visitor to process this message. * Accepts a visitor to process this message.
* *

View File

@@ -98,7 +98,8 @@ public UUID getEnemyPieceIdentifier() {
*/ */
@Override @Override
public String toString() { public String toString() {
return "RequestPlayCard={card=" + card.toString() + '}'; assert card != null;
return "RequestPlayCard={card=" + card + '}';
} }
/** /**

View File

@@ -58,14 +58,4 @@ public void accept(ServerInterpreter interpreter) {
public String toString() { public String toString() {
return "ActivePlayer{color=" + color + '}'; return "ActivePlayer{color=" + color + '}';
} }
/**
* Returns the key for the informational text associated with this message.
*
* @return the key for the informational text
*/
@Override
public String getInfoTextKey() {
return "";
}
} }

View File

@@ -61,14 +61,4 @@ public void accept(ServerInterpreter interpreter) {
public String toString() { public String toString() {
return "AnyPiece{piece=" + piece + '}'; return "AnyPiece{piece=" + piece + '}';
} }
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
}
} }

View File

@@ -23,24 +23,4 @@ public BriefingMessage() {
public void accept(ServerInterpreter interpreter) { public void accept(ServerInterpreter interpreter) {
interpreter.received(this); interpreter.received(this);
} }
/**
* Returns a string representation of this message.
*
* @return a string representation of this message
*/
@Override
public String toString() {
return "";
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
}
} }

View File

@@ -23,24 +23,4 @@ public CeremonyMessage() {
public void accept(ServerInterpreter interpreter) { public void accept(ServerInterpreter interpreter) {
interpreter.received(this); interpreter.received(this);
} }
/**
* Returns a string representation of this message.
*
* @return a string representation of this message
*/
@Override
public String toString() {
return "";
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
}
} }

View File

@@ -23,24 +23,4 @@ public DiceAgainMessage() {
public void accept(ServerInterpreter interpreter) { public void accept(ServerInterpreter interpreter) {
interpreter.received(this); interpreter.received(this);
} }
/**
* Returns a string representation of this message.
*
* @return a string representation of this message
*/
@Override
public String toString() {
return "";
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
}
} }

View File

@@ -23,24 +23,4 @@ public DiceNowMessage() {
public void accept(ServerInterpreter interpreter) { public void accept(ServerInterpreter interpreter) {
interpreter.received(this); interpreter.received(this);
} }
/**
* Returns a string representation of this message.
*
* @return a string representation of this message
*/
@Override
public String toString() {
return "";
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
}
} }

View File

@@ -57,16 +57,6 @@ public void accept(ServerInterpreter interpreter) {
*/ */
@Override @Override
public String toString() { public String toString() {
return ""; return "DieMessage{" + "diceEye=" + diceEye + '}';
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
} }
} }

View File

@@ -23,24 +23,4 @@ public EndOfTurnMessage() {
public void accept(ServerInterpreter interpreter) { public void accept(ServerInterpreter interpreter) {
interpreter.received(this); interpreter.received(this);
} }
/**
* Returns a string representation of this message.
*
* @return a string representation of this message
*/
@Override
public String toString() {
return "";
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
}
} }

View File

@@ -34,18 +34,6 @@ public IncorrectRequestMessage() {
public void accept(ServerInterpreter interpreter) { public void accept(ServerInterpreter interpreter) {
interpreter.received(this); interpreter.received(this);
} }
/**
* Gets the bundle key of the informational text to be shown at the client.
* This key is used to retrieve the appropriate localized text for display.
*
* @return the bundle key of the informational text
*/
@Override
public String getInfoTextKey() {
return "";
}
/** /**
* This method will be used to return necessary class information in a more readable format. * This method will be used to return necessary class information in a more readable format.
* *

View File

@@ -39,7 +39,6 @@ public int getHost() {
return this.host; return this.host;
} }
/** /**
* Accepts a visitor to process this message. * Accepts a visitor to process this message.
* *
@@ -51,22 +50,12 @@ public void accept(ServerInterpreter interpreter) {
} }
/** /**
* Returns a string representation of this message. * This method will be used to return necessary class information in a more readable format.
* *
* @return a string representation of this message * @return information as a String.
*/ */
@Override @Override
public String toString() { public String toString() {
return "Lobby Accept"; return "LobbyAcceptMessage with host: %d".formatted(this.host);
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
} }
} }

View File

@@ -23,24 +23,4 @@ public LobbyDenyMessage() {
public void accept(ServerInterpreter interpreter) { public void accept(ServerInterpreter interpreter) {
interpreter.received(this); interpreter.received(this);
} }
/**
* Returns a string representation of this message.
*
* @return a string representation of this message
*/
@Override
public String toString() {
return "LobbyDeny";
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
}
} }

View File

@@ -79,23 +79,8 @@ public void accept(ServerInterpreter interpreter) {
interpreter.received(this); interpreter.received(this);
} }
/**
* Returns a string representation of this message.
*
* @return a string representation of this message
*/
@Override @Override
public String toString() { public String toString() {
return ""; return "LobbyPlayerJoinedMessage{" + "player=" + player + ", id=" + id + ", host=" + host + '}';
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
} }
} }

View File

@@ -56,16 +56,6 @@ public void accept(ServerInterpreter interpreter) {
*/ */
@Override @Override
public String toString() { public String toString() {
return ""; return "LobbyPlayerLeaveMessage{" + "id=" + id + '}';
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
} }
} }

View File

@@ -89,16 +89,6 @@ public void accept(ServerInterpreter interpreter) {
*/ */
@Override @Override
public String toString() { public String toString() {
return ""; return "MoveMessage{" + "pieceUUID=" + pieceUUID + ", targetIndex=" + targetIndex + ", isHomeMove=" + isHomeMove + '}';
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
} }
} }

View File

@@ -23,24 +23,4 @@ public NoTurnMessage() {
public void accept(ServerInterpreter interpreter) { public void accept(ServerInterpreter interpreter) {
interpreter.received(this); interpreter.received(this);
} }
/**
* Returns a string representation of this message.
*
* @return a string representation of this message
*/
@Override
public String toString() {
return "";
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
}
} }

View File

@@ -54,16 +54,6 @@ public void accept(ServerInterpreter interpreter) {
*/ */
@Override @Override
public String toString() { public String toString() {
return ""; return "PauseGameMessage{" + "playerId=" + playerId + '}';
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
} }
} }

View File

@@ -135,16 +135,6 @@ public void accept(ServerInterpreter interpreter) {
*/ */
@Override @Override
public String toString() { public String toString() {
return ""; return "PlayCardMessage{" + "card=" + card + ", ownPieceID=" + ownPieceID + ", enemyPieceID=" + enemyPieceID + ", diceModifier=" + diceModifier + '}';
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
} }
} }

View File

@@ -59,16 +59,6 @@ public void accept(ServerInterpreter interpreter) {
*/ */
@Override @Override
public String toString() { public String toString() {
return ""; return "PossibleCardMessage{" + "possibleCards=" + possibleCards + '}';
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
} }
} }

View File

@@ -33,7 +33,7 @@ public PossiblePieceMessage() {
/** /**
* Swap the possible pieces * Swap the possible pieces
* *
* @param possibleOwnPieces the list of possible own pieces * @param possibleOwnPieces the list of possible own pieces
* @param possibleEnemyPieces the list of possible enemy pieces * @param possibleEnemyPieces the list of possible enemy pieces
* @return the swapped possible pieces * @return the swapped possible pieces
*/ */
@@ -50,7 +50,7 @@ public static PossiblePieceMessage swapPossiblePieces(ArrayList<UUID> possibleOw
* @param possibleOwnPieces the list of possible own pieces * @param possibleOwnPieces the list of possible own pieces
* @return the possible pieces for the shield * @return the possible pieces for the shield
*/ */
public static PossiblePieceMessage shieldPossiblePieces(ArrayList<UUID> possibleOwnPieces){ public static PossiblePieceMessage shieldPossiblePieces(ArrayList<UUID> possibleOwnPieces) {
PossiblePieceMessage possiblePieceMessage = new PossiblePieceMessage(); PossiblePieceMessage possiblePieceMessage = new PossiblePieceMessage();
possiblePieceMessage.possibleOwnPieces.addAll(possibleOwnPieces); possiblePieceMessage.possibleOwnPieces.addAll(possibleOwnPieces);
return possiblePieceMessage; return possiblePieceMessage;
@@ -74,14 +74,18 @@ public void addEnemyPossiblePiece(UUID piece) {
this.possibleEnemyPieces.add(piece); this.possibleEnemyPieces.add(piece);
} }
/** Getter for the list of possible pieces /**
* Getter for the list of possible pieces
*
* @return the list of possible pieces * @return the list of possible pieces
*/ */
public List<UUID> getOwnPossiblePieces() { public List<UUID> getOwnPossiblePieces() {
return possibleOwnPieces; return possibleOwnPieces;
} }
/** Getter for the list of possible enemy pieces /**
* Getter for the list of possible enemy pieces
*
* @return the list of possible enemy pieces * @return the list of possible enemy pieces
*/ */
public List<UUID> getEnemyPossiblePieces() { public List<UUID> getEnemyPossiblePieces() {
@@ -105,16 +109,6 @@ public void accept(ServerInterpreter interpreter) {
*/ */
@Override @Override
public String toString() { public String toString() {
return ""; return "PossiblePieceMessage{" + "possibleOwnPieces=" + possibleOwnPieces + ", possibleEnemyPieces=" + possibleEnemyPieces + '}';
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
} }
} }

View File

@@ -52,16 +52,6 @@ public void accept(ServerInterpreter interpreter) {
*/ */
@Override @Override
public String toString() { public String toString() {
return ""; return "RankingResponseMessage{" + "startingPlayerId=" + startingPlayerId + '}';
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
} }
} }

View File

@@ -23,24 +23,4 @@ public RankingRollAgainMessage() {
public void accept(ServerInterpreter interpreter) { public void accept(ServerInterpreter interpreter) {
interpreter.received(this); interpreter.received(this);
} }
/**
* Returns a string representation of this message.
*
* @return a string representation of this message
*/
@Override
public String toString() {
return "";
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
}
} }

View File

@@ -54,16 +54,6 @@ public void accept(ServerInterpreter interpreter) {
*/ */
@Override @Override
public String toString() { public String toString() {
return ""; return "ReconnectBriefingMessage{" + "game=" + game + '}';
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
} }
} }

View File

@@ -23,24 +23,4 @@ public ResumeGameMessage() {
public void accept(ServerInterpreter interpreter) { public void accept(ServerInterpreter interpreter) {
interpreter.received(this); interpreter.received(this);
} }
/**
* Returns a string representation of this message.
*
* @return a string representation of this message
*/
@Override
public String toString() {
return "";
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
}
} }

View File

@@ -77,7 +77,7 @@ public void accept(ServerInterpreter interpreter) {
* @return a string representation of this message * @return a string representation of this message
*/ */
@Override @Override
public String getInfoTextKey() { public String toString() {
return ""; return "SelectPieceMessage{" + "pieces=" + pieces + ", isHomeMove=" + isHomeMove + ", targetIndex=" + targetIndex + '}';
} }
} }

View File

@@ -22,10 +22,12 @@ protected ServerMessage() {
public abstract void accept(ServerInterpreter interpreter); public abstract void accept(ServerInterpreter interpreter);
/** /**
* Gets the bundle key of the informational text to be shown at the client. * Returns a string representation of this message.
* This key is used to retrieve the appropriate localized text for display.
* *
* @return the bundle key of the informational text * @return a string representation of this message
*/ */
public abstract String getInfoTextKey(); @Override
public String toString() {
return getClass().getSimpleName() + "{}";
}
} }

View File

@@ -74,16 +74,7 @@ public void accept(ServerInterpreter interpreter) {
*/ */
@Override @Override
public String toString() { public String toString() {
return ""; return "ServerStartGameMessage{" + "players=" + players + ", board=" + board + '}';
} }
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
}
} }

View File

@@ -16,15 +16,4 @@ public class ShutdownMessage extends ServerMessage {
public void accept(ServerInterpreter interpreter) { public void accept(ServerInterpreter interpreter) {
interpreter.received(this); interpreter.received(this);
} }
/**
* Gets the bundle key of the informational text to be shown at the client.
* This key is used to retrieve the appropriate localized text for display.
*
* @return the bundle key of the informational text
*/
@Override
public String getInfoTextKey() {
return "";
}
} }

View File

@@ -5,7 +5,7 @@
*/ */
public class SpectatorMessage extends ServerMessage { public class SpectatorMessage extends ServerMessage {
/** /**
* Construc * Constructor
*/ */
public SpectatorMessage() { public SpectatorMessage() {
super(); super();
@@ -19,14 +19,4 @@ public SpectatorMessage() {
public void accept(ServerInterpreter interpreter) { public void accept(ServerInterpreter interpreter) {
interpreter.received(this); interpreter.received(this);
} }
/**
*
* @return
*/
@Override
public String getInfoTextKey() {
return "";
}
} }

View File

@@ -75,16 +75,6 @@ public void accept(ServerInterpreter interpreter) {
*/ */
@Override @Override
public String toString() { public String toString() {
return ""; return "StartPieceMessage{" + "pieceIdentifier=" + pieceIdentifier + ", targetIndex=" + targetIndex + '}';
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
} }
} }

View File

@@ -73,16 +73,6 @@ public void accept(ServerInterpreter interpreter) {
*/ */
@Override @Override
public String toString() { public String toString() {
return ""; return "UpdateReadyMessage{" + "playerId=" + playerId + ", ready=" + ready + '}';
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
} }
} }

View File

@@ -58,6 +58,15 @@ public Color getColor() {
return color; return color;
} }
/**
* Checks if the TSK is taken.
*
* @return true if the TSK is taken, false otherwise
*/
public boolean isTaken() {
return isTaken;
}
/** /**
* Accepts a visitor to process this message. * Accepts a visitor to process this message.
* *
@@ -75,20 +84,6 @@ public void accept(ServerInterpreter interpreter) {
*/ */
@Override @Override
public String toString() { public String toString() {
return ""; return "UpdateTSKMessage{" + "id=" + id + ", color=" + color + '}';
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
}
public boolean isTaken() {
return isTaken;
} }
} }

View File

@@ -54,16 +54,6 @@ public void accept(ServerInterpreter interpreter) {
*/ */
@Override @Override
public String toString() { public String toString() {
return ""; return "WaitPieceMessage{" + "pieceID=" + pieceID + '}';
}
/**
* Returns the key for the info text of this message.
*
* @return the key for the info text of this message
*/
@Override
public String getInfoTextKey() {
return "";
} }
} }