Initial problem solving (identified by Intellij)
This commit is contained in:
@@ -121,7 +121,7 @@ public class ClientLauncherTUI {
|
||||
if (!doLogin(controller)) continue;
|
||||
|
||||
while (controller.getClient() != null) {
|
||||
String prompt = buildPrompt(controller);
|
||||
String prompt = buildPrompt();
|
||||
String line;
|
||||
try {
|
||||
line = gameReader.readLine(prompt);
|
||||
@@ -247,10 +247,9 @@ public class ClientLauncherTUI {
|
||||
/**
|
||||
* Returns the command-line prompt string showing the current username.
|
||||
*
|
||||
* @param controller the client controller (reserved for future use).
|
||||
* @return the prompt string.
|
||||
*/
|
||||
private String buildPrompt(ClientController controller) {
|
||||
private String buildPrompt() {
|
||||
return currentUsername.isEmpty() ? "> " : currentUsername + "> ";
|
||||
}
|
||||
|
||||
@@ -270,7 +269,7 @@ public class ClientLauncherTUI {
|
||||
if (pos >= 0) controller.totemChoice(pos);
|
||||
}
|
||||
case "skip" -> controller.skipTurn();
|
||||
case "clear" -> handleRender(parts);
|
||||
case "clear" -> handleRender();
|
||||
case "help" -> gameReader.printAbove("Commands: slot, draw, totem, skip, clear, help, details, rematch, quit");
|
||||
case "details" -> {
|
||||
if (parts.length > 1 && parts[1].equalsIgnoreCase("buildings"))
|
||||
@@ -325,9 +324,8 @@ public class ClientLauncherTUI {
|
||||
/**
|
||||
* Handles the {@code clear} command by triggering a full board re-render.
|
||||
*
|
||||
* @param parts the tokenised command (only the command token is used).
|
||||
*/
|
||||
private void handleRender(String[] parts) {
|
||||
private void handleRender() {
|
||||
view.renderBoard();
|
||||
}
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user